[media] DaVinci-VPFE-Capture: Improve another size determination in vpfe_open()
authorMarkus Elfring <elfring@users.sourceforge.net>
Wed, 12 Oct 2016 08:44:05 +0000 (05:44 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 16 Nov 2016 14:44:17 +0000 (12:44 -0200)
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/davinci/vpfe_capture.c

index cee14aa..ab073f2 100644 (file)
@@ -511,7 +511,7 @@ static int vpfe_open(struct file *file)
        }
 
        /* Allocate memory for the file handle object */
-       fh = kmalloc(sizeof(struct vpfe_fh), GFP_KERNEL);
+       fh = kmalloc(sizeof(*fh), GFP_KERNEL);
        if (!fh)
                return -ENOMEM;