* [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
@ 2024-07-17 14:12 Bastien Curutchet
2024-07-17 14:22 ` David Lechner
0 siblings, 1 reply; 4+ messages in thread
From: Bastien Curutchet @ 2024-07-17 14:12 UTC (permalink / raw)
To: David Lechner, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Thomas Petazzoni, Herve Codina,
Christopher Cordahi, Bastien Curutchet
The flag attribute of the struct clk_init_data isn't initialized before
the devm_clk_hw_register() call. This can lead to unexpected behavior
during registration.
Initialize the entire clk_init_data to zero at declaration.
Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
---
drivers/clk/davinci/da8xx-cfgchip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/davinci/da8xx-cfgchip.c b/drivers/clk/davinci/da8xx-cfgchip.c
index ad2d0df43dc6..ec60ecb517f1 100644
--- a/drivers/clk/davinci/da8xx-cfgchip.c
+++ b/drivers/clk/davinci/da8xx-cfgchip.c
@@ -508,7 +508,7 @@ da8xx_cfgchip_register_usb0_clk48(struct device *dev,
const char * const parent_names[] = { "usb_refclkin", "pll0_auxclk" };
struct clk *fck_clk;
struct da8xx_usb0_clk48 *usb0;
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
fck_clk = devm_clk_get(dev, "fck");
@@ -583,7 +583,7 @@ da8xx_cfgchip_register_usb1_clk48(struct device *dev,
{
const char * const parent_names[] = { "usb0_clk48", "usb_refclkin" };
struct da8xx_usb1_clk48 *usb1;
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
usb1 = devm_kzalloc(dev, sizeof(*usb1), GFP_KERNEL);
--
2.45.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
2024-07-17 14:12 [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use Bastien Curutchet
@ 2024-07-17 14:22 ` David Lechner
2024-07-17 14:46 ` Bastien Curutchet
0 siblings, 1 reply; 4+ messages in thread
From: David Lechner @ 2024-07-17 14:22 UTC (permalink / raw)
To: Bastien Curutchet, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Thomas Petazzoni, Herve Codina,
Christopher Cordahi
On 7/17/24 9:12 AM, Bastien Curutchet wrote:
> The flag attribute of the struct clk_init_data isn't initialized before
> the devm_clk_hw_register() call. This can lead to unexpected behavior
> during registration.
>
> Initialize the entire clk_init_data to zero at declaration.
>
Probably should add a Fixes: tag.
> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
> ---
Reviewed-by: David Lechner <david@lechnology.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
2024-07-17 14:22 ` David Lechner
@ 2024-07-17 14:46 ` Bastien Curutchet
2024-07-17 15:54 ` David Lechner
0 siblings, 1 reply; 4+ messages in thread
From: Bastien Curutchet @ 2024-07-17 14:46 UTC (permalink / raw)
To: David Lechner, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Thomas Petazzoni, Herve Codina,
Christopher Cordahi
Hi David,
On 7/17/24 16:22, David Lechner wrote:
> On 7/17/24 9:12 AM, Bastien Curutchet wrote:
>> The flag attribute of the struct clk_init_data isn't initialized before
>> the devm_clk_hw_register() call. This can lead to unexpected behavior
>> during registration.
>>
>> Initialize the entire clk_init_data to zero at declaration.
>>
>
> Probably should add a Fixes: tag.
>
Sorry I forgot about it, that would be :
Fixes: 58e1e2d2cd89 ("clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks")
Do I need to send a new iteration with it ?
>> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
>> ---
>
> Reviewed-by: David Lechner <david@lechnology.com>
>
>
Best regards,
Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use
2024-07-17 14:46 ` Bastien Curutchet
@ 2024-07-17 15:54 ` David Lechner
0 siblings, 0 replies; 4+ messages in thread
From: David Lechner @ 2024-07-17 15:54 UTC (permalink / raw)
To: Bastien Curutchet, Michael Turquette, Stephen Boyd
Cc: linux-clk, linux-kernel, Thomas Petazzoni, Herve Codina,
Christopher Cordahi
On 7/17/24 9:46 AM, Bastien Curutchet wrote:
> Hi David,
>
> On 7/17/24 16:22, David Lechner wrote:
>> On 7/17/24 9:12 AM, Bastien Curutchet wrote:
>>> The flag attribute of the struct clk_init_data isn't initialized before
>>> the devm_clk_hw_register() call. This can lead to unexpected behavior
>>> during registration.
>>>
>>> Initialize the entire clk_init_data to zero at declaration.
>>>
>>
>> Probably should add a Fixes: tag.
>>
>
> Sorry I forgot about it, that would be :
>
> Fixes: 58e1e2d2cd89 ("clk: davinci: cfgchip: Add TI DA8XX USB PHY clocks")
>
>
> Do I need to send a new iteration with it ?
That's ultimately up to Stephen, I guess, since he is usually the one
picking up the patches. But I think it wouldn't hurt if you did.
>
>>> Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
>>> ---
>>
>> Reviewed-by: David Lechner <david@lechnology.com>
>>
>>
>
> Best regards,
> Bastien
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-17 15:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 14:12 [PATCH] clk: davinci: da8xx-cfgchip: Initialize clk_init_data before use Bastien Curutchet
2024-07-17 14:22 ` David Lechner
2024-07-17 14:46 ` Bastien Curutchet
2024-07-17 15:54 ` David Lechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®