pinctrl: exynos5440: fix invalid use of sizeof in exynos5440_pinctrl_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 14 Mar 2013 13:59:38 +0000 (21:59 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 27 Mar 2013 21:23:47 +0000 (22:23 +0100)
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-exynos5440.c

index 169ea3e5f777a4d414d90106ba8c3cd62f2e9f5f..eb8e502e11efd9b1190be3e81593e0d9252021db 100644 (file)
@@ -854,7 +854,7 @@ static int exynos5440_pinctrl_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       priv = devm_kzalloc(dev, sizeof(priv), GFP_KERNEL);
+       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv) {
                dev_err(dev, "could not allocate memory for private data\n");
                return -ENOMEM;