summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fops.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-12-04 11:56:42 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-04 13:28:42 +0100
commita0a0bde32a4668656cdffac677032a101c170c6b (patch)
tree379301f4c752b825b23d48ee9ced899337c4225b /drivers/gpu/drm/drm_fops.c
parente2beb6cd5d0f6f0f6e71fe200a674932194a8e84 (diff)
downloadlinux-a0a0bde32a4668656cdffac677032a101c170c6b.tar.gz
linux-a0a0bde32a4668656cdffac677032a101c170c6b.tar.bz2
linux-a0a0bde32a4668656cdffac677032a101c170c6b.zip
drm: Fix memory leak at error path of drm_read()
Note that the read manpages explicitly states that the read position is undefined on error. Since EFAULT is just a userspace bug we are therefore fine with just dropping the event on the floor. Signed-off-by: Takashi Iwai <tiwai@suse.de> [danvet: Add note that just dropping the event is ok.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r--drivers/gpu/drm/drm_fops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 91e1105f2800..0b9514b6cd64 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -527,6 +527,7 @@ ssize_t drm_read(struct file *filp, char __user *buffer,
if (copy_to_user(buffer + total,
e->event, e->event->length)) {
total = -EFAULT;
+ e->destroy(e);
break;
}