s5p-mfc: Improve a size determination in s5p_mfc_alloc_memdev()
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 8 Sep 2017 20:30:09 +0000 (22:30 +0200)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 14 Feb 2019 05:55:57 +0000 (14:55 +0900)
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 according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc.c

index 339d6b9..6c0990c 100644 (file)
@@ -1084,7 +1084,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
        struct device *child;
        int ret;
 
-       child = devm_kzalloc(dev, sizeof(struct device), GFP_KERNEL);
+       child = devm_kzalloc(dev, sizeof(*child), GFP_KERNEL);
        if (!child)
                return NULL;