Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473421 > unrolled thread

[PATCH] pinctrl: intel: merrifield: fix dup size in probe

Started byVincent Stehlé <vincent.stehle@intel.com>
First post2016-08-31 14:40 +0200
Last post2016-09-07 22:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] pinctrl: intel: merrifield: fix dup size in probe Vincent Stehlé <vincent.stehle@intel.com> - 2016-08-31 14:40 +0200
    Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-08-31 16:00 +0200
    Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe Linus Walleij <linus.walleij@linaro.org> - 2016-09-07 22:10 +0200

#1473421 — [PATCH] pinctrl: intel: merrifield: fix dup size in probe

FromVincent Stehlé <vincent.stehle@intel.com>
Date2016-08-31 14:40 +0200
Subject[PATCH] pinctrl: intel: merrifield: fix dup size in probe
Message-ID<sccYa-2pg-11@gated-at.bofh.it>
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>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c
index 7fb7656..7826c7f 100644
--- a/drivers/pinctrl/intel/pinctrl-merrifield.c
+++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
@@ -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;
-- 
2.9.3

[toc] | [next] | [standalone]


#1473505

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2016-08-31 16:00 +0200
Message-ID<scedB-34F-53@gated-at.bofh.it>
In reply to#1473421
On Wed, 2016-08-31 at 14:30 +0200, Vincent Stehlé wrote:
> 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.

Good catch!
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

P.S. Linus, perhaps this is material for -rc5.

> 
> Fixes: 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin
> controller support")
> Signed-off-by: Vincent Stehlé <vincent.stehle@intel.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c
> b/drivers/pinctrl/intel/pinctrl-merrifield.c
> index 7fb7656..7826c7f 100644
> --- a/drivers/pinctrl/intel/pinctrl-merrifield.c
> +++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
> @@ -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;

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

[toc] | [prev] | [next] | [standalone]


#1478588

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-09-07 22:10 +0200
Message-ID<seRkt-4qy-5@gated-at.bofh.it>
In reply to#1473421
On Wed, Aug 31, 2016 at 2:30 PM, Vincent Stehlé
<vincent.stehle@intel.com> wrote:

> 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>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>

Patch applied for fixes with Andy's ACK.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web