drm/savage: dereferencing an error pointer
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 12 Oct 2016 06:22:27 +0000 (09:22 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 13 Oct 2016 05:56:14 +0000 (07:56 +0200)
commitf7741aa75e76440f4e9ecfe512feebe9bce33ca8
treed01b507f23ef1a21f6d77ba187494e11d6307e17
parent1550333c597a98fc1bb529167ecf22333a3b4b39
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
drivers/gpu/drm/savage/savage_state.c