diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-10-12 09:22:27 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-10-13 07:56:14 +0200 |
commit | f7741aa75e76440f4e9ecfe512feebe9bce33ca8 (patch) | |
tree | d01b507f23ef1a21f6d77ba187494e11d6307e17 | |
parent | 1550333c597a98fc1bb529167ecf22333a3b4b39 (diff) | |
download | op-kernel-dev-f7741aa75e76440f4e9ecfe512feebe9bce33ca8.zip op-kernel-dev-f7741aa75e76440f4e9ecfe512feebe9bce33ca8.tar.gz |
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
-rw-r--r-- | drivers/gpu/drm/savage/savage_state.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c index 3dc0d8f..2db89be 100644 --- a/drivers/gpu/drm/savage/savage_state.c +++ b/drivers/gpu/drm/savage/savage_state.c @@ -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; |