mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-20 08:40:47 +00:00
drm/savage: dereferencing an error pointer
A recent cleanup changed the kmalloc() + copy_from_user() to memdup_user() but the error handling wasn't updated so we might call kfree(-EFAULT) and crash. Fixes: a6e3918bcdb1 ('GPU-DRM-Savage: Use memdup_user() rather than duplicating') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20161012062227.GU12841@mwanda
This commit is contained in:
parent
1550333c59
commit
f7741aa75e
@ -1004,6 +1004,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
|
||||
kvb_addr = memdup_user(cmdbuf->vb_addr, cmdbuf->vb_size);
|
||||
if (IS_ERR(kvb_addr)) {
|
||||
ret = PTR_ERR(kvb_addr);
|
||||
kvb_addr = NULL;
|
||||
goto done;
|
||||
}
|
||||
cmdbuf->vb_addr = kvb_addr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user