linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: intel: merrifield: fix dup size in probe
       [not found] <1466678976-52598-1-git-send-email-andriy.shevchenko@linux.intel.com>
@ 2016-08-31 12:30 ` Vincent Stehlé
  2016-08-31 13:54   ` Andy Shevchenko
  2016-09-07 20:00   ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Stehlé @ 2016-08-31 12:30 UTC (permalink / raw)
  To: linux-gpio
  Cc: linux-kernel, Vincent Stehlé, Andy Shevchenko, Linus Walleij

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe
  2016-08-31 12:30 ` [PATCH] pinctrl: intel: merrifield: fix dup size in probe Vincent Stehlé
@ 2016-08-31 13:54   ` Andy Shevchenko
  2016-09-07 20:00   ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2016-08-31 13:54 UTC (permalink / raw)
  To: Vincent Stehlé, linux-gpio; +Cc: linux-kernel, Linus Walleij

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe
  2016-08-31 12:30 ` [PATCH] pinctrl: intel: merrifield: fix dup size in probe Vincent Stehlé
  2016-08-31 13:54   ` Andy Shevchenko
@ 2016-09-07 20:00   ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-09-07 20:00 UTC (permalink / raw)
  To: Vincent Stehlé; +Cc: linux-gpio, linux-kernel, Andy Shevchenko

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-07 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1466678976-52598-1-git-send-email-andriy.shevchenko@linux.intel.com>
2016-08-31 12:30 ` [PATCH] pinctrl: intel: merrifield: fix dup size in probe Vincent Stehlé
2016-08-31 13:54   ` Andy Shevchenko
2016-09-07 20:00   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).