ti: fix possible memory leak in _ti_omap4_clkctrl_setup()
Subsystems (2)
PATCH v3 1/1 ti: fix possible memory leak in _ti_omap4_clkctrl_setup()
kstrndup() and kstrdup_and_replace() in clkctrl_get_name() can perform dynamic memory allocation. So clkctrl_name needs to be freed when provider->clkdm_name is NULL.
---
v2 and v3: fix commit info.
drivers/clk/ti/clkctrl.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/ti/clkctrl.c +1 -0
@@ -591,6 +591,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) provider->clkdm_name =kasprintf (GFP_KERNEL ,"%s_clkdm" , clkctrl_name);if (!provider->clkdm_name) { +kfree (clkctrl_name);kfree (provider);return ; }
Signature · 1 line
2.34.1
Quoted 9 lines · Hangyu Hua
kstrndup()andkstrdup_and_replace()inclkctrl_get_name()can perform dynamic memory allocation. Soclkctrl_nameneeds to be freed whenprovider->clkdm_nameis NULL.Fixes bd46cd0b802d ("clk: ti: clkctrl: check return value of kasprintf()")Signed-off-by Hangyu Hua <[email protected]>---
v2 and v3: fix commit info.
I believe I gave you my Rb tag. It's your responsibility to care it on if you send a new version. Otherwise, please tell what makes you think that tag should not be here?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Hangyu Hua
kstrndup()andkstrdup_and_replace()inclkctrl_get_name()can perform dynamic memory allocation. Soclkctrl_nameneeds to be freed whenprovider->clkdm_nameis NULL.Fixes bd46cd0b802d ("clk: ti: clkctrl: check return value of kasprintf()")Signed-off-by Hangyu Hua <[email protected]>---
Quoted 5 lines
Quoted 1 line
v2 and v3: fix commit info.
I believe I gave you my Rb tag. It's your responsibility to care it on if you send a new version. Otherwise, please tell what makes you think that tag should not be here?
Do you mean "Reviewed-by"? I checked the previous emails and "lore.kernel.org" and didn’t find this tag in any related emails. I am not sure what happened. Can you please resend it?
Thanks,
Hangyu