Staging: dream, fix buf overflow
authorJiri Slaby <jirislaby@gmail.com>
Sat, 8 Aug 2009 09:33:58 +0000 (11:33 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:02:04 +0000 (12:02 -0700)
In vfe_send_msg_no_payload there is a wrong struct vfe_message allocation.
It allocates only sizeof(pointer to vfe_message) for a whole structure.
Add a dereference to the sizeof to allocate sizeof(vfe_message).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/dream/camera/msm_vfe8x_proc.c

index bb650134021131aad0b75104d1a9e80c274aef79..5436f71200187cb6edee0bd4d25c9aacf0dedca6 100644 (file)
@@ -818,7 +818,7 @@ static void vfe_send_msg_no_payload(enum VFE_MESSAGE_ID id)
 {
        struct vfe_message *msg;
 
-       msg = kzalloc(sizeof(msg), GFP_ATOMIC);
+       msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
        if (!msg)
                return;