]> git.karo-electronics.de Git - linux-beck.git/commitdiff
pinctrl: intel: merrifield: fix dup size in probe
authorVincent Stehlé <vincent.stehle@intel.com>
Wed, 31 Aug 2016 12:30:50 +0000 (14:30 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 12 Sep 2016 13:45:16 +0000 (15:45 +0200)
In function mrfld_pinctrl_probe(), when duplicating the mrfld_families
array the requested memory region length is multiplied once too many by the
number of elements in the original array. Fix this to spare some memory.

Fixes: 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin controller support")
Signed-off-by: Vincent Stehlé <vincent.stehle@intel.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/intel/pinctrl-merrifield.c

index 7fb765642ee78bc320a30c04bf3bf8d1a4724878..7826c7f0cb7cac1959e0c8efb27a0c546f09b060 100644 (file)
@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
         */
        nfamilies = ARRAY_SIZE(mrfld_families),
        families = devm_kmemdup(&pdev->dev, mrfld_families,
-                                           nfamilies * sizeof(mrfld_families),
+                                           sizeof(mrfld_families),
                                            GFP_KERNEL);
        if (!families)
                return -ENOMEM;