From: Julia Lawall Date: Mon, 30 Jan 2012 11:05:55 +0000 (+0100) Subject: drivers/gpu/drm/drm_ioc32.c: initialize all fields X-Git-Tag: MMI-PSA29.97-13-9~17468^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=08bc3d4e67d486a9b2a5065c1c2ebaf13048a465;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drivers/gpu/drm/drm_ioc32.c: initialize all fields The c32 structure is allocated on the stack and its idx field is not initialized before copying it to user level. This patch takes the value from the result of the ioctl, as done for the other fields. Signed-off-by: Julia Lawall Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index ddd70db45f76..637fcc3766c7 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -315,7 +315,8 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd, if (err) return err; - if (__get_user(c32.auth, &client->auth) + if (__get_user(c32.idx, &client->idx) + || __get_user(c32.auth, &client->auth) || __get_user(c32.pid, &client->pid) || __get_user(c32.uid, &client->uid) || __get_user(c32.magic, &client->magic)