* [PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk
@ 2014-02-10 19:10 Colin King
2014-02-10 19:54 ` Lee Jones
0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2014-02-10 19:10 UTC (permalink / raw)
To: Samuel Ortiz, Lee Jones, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
ch_clk was erroneously being allocated the incorrect size which
can be problematic for larger sizes of tll->nch
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/mfd/omap-usb-tll.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 5ee50f7..532eacab 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -252,7 +252,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
break;
}
- tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk * [tll->nch]),
+ tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
GFP_KERNEL);
if (!tll->ch_clk) {
ret = -ENOMEM;
--
1.9.rc1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk
2014-02-10 19:10 [PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk Colin King
@ 2014-02-10 19:54 ` Lee Jones
2014-02-11 8:54 ` Roger Quadros
0 siblings, 1 reply; 3+ messages in thread
From: Lee Jones @ 2014-02-10 19:54 UTC (permalink / raw)
To: Colin King; +Cc: Samuel Ortiz, linux-kernel, rogerq
> From: Colin Ian King <colin.king@canonical.com>
>
> ch_clk was erroneously being allocated the incorrect size which
> can be problematic for larger sizes of tll->nch
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/mfd/omap-usb-tll.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
> index 5ee50f7..532eacab 100644
> --- a/drivers/mfd/omap-usb-tll.c
> +++ b/drivers/mfd/omap-usb-tll.c
> @@ -252,7 +252,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
> break;
> }
>
> - tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk * [tll->nch]),
> + tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
> GFP_KERNEL);
> if (!tll->ch_clk) {
> ret = -ENOMEM;
Thanks Colin, patch looks good to me.
Roger, fancy finishing this off with an Acked-by?
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk
2014-02-10 19:54 ` Lee Jones
@ 2014-02-11 8:54 ` Roger Quadros
0 siblings, 0 replies; 3+ messages in thread
From: Roger Quadros @ 2014-02-11 8:54 UTC (permalink / raw)
To: Colin King; +Cc: Lee Jones, Samuel Ortiz, linux-kernel
Hi Colin,
On 02/10/2014 09:54 PM, Lee Jones wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> ch_clk was erroneously being allocated the incorrect size which
>> can be problematic for larger sizes of tll->nch
The code fix is good but the subject and description aren't right.
You could instead mention about the cppcheck warning and hard to read
code.
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> drivers/mfd/omap-usb-tll.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
>> index 5ee50f7..532eacab 100644
>> --- a/drivers/mfd/omap-usb-tll.c
>> +++ b/drivers/mfd/omap-usb-tll.c
>> @@ -252,7 +252,7 @@ static int usbtll_omap_probe(struct platform_device *pdev)
>> break;
>> }
>>
>> - tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk * [tll->nch]),
>> + tll->ch_clk = devm_kzalloc(dev, sizeof(struct clk *) * tll->nch,
>> GFP_KERNEL);
>> if (!tll->ch_clk) {
>> ret = -ENOMEM;
>
> Thanks Colin, patch looks good to me.
>
> Roger, fancy finishing this off with an Acked-by?
>
cheers,
-roger
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-11 8:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 19:10 [PATCH] mfd: omap-usb-tll: allocate correct size for ch_clk Colin King
2014-02-10 19:54 ` Lee Jones
2014-02-11 8:54 ` Roger Quadros
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.