* [PATCH v2] usb: gadget: m66592-udc: Add check for clk_enable()
@ 2024-12-26 1:33 Mingwei Zheng
2024-12-27 12:08 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Mingwei Zheng @ 2024-12-26 1:33 UTC (permalink / raw)
To: gregkh
Cc: u.kleine-koenig, linux-usb, linux-kernel, Mingwei Zheng,
Jiasheng Jiang
The APP-Miner reported the missing check.
Add check for the return value of clk_enable() to catch the potential
error.
Fixes: b4822e2317e8 ("usb: gadget: m66592-udc: Convert to use module_platform_driver()")
Signed-off-by: Mingwei Zheng <zmw12306@gmail.com>
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
---
Changelog:
v1 -> v2
1. Add tool name in commit msg.
---
drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/m66592-udc.c b/drivers/usb/gadget/udc/m66592-udc.c
index a938b2af0944..bf408476a24c 100644
--- a/drivers/usb/gadget/udc/m66592-udc.c
+++ b/drivers/usb/gadget/udc/m66592-udc.c
@@ -1606,7 +1606,11 @@ static int m66592_probe(struct platform_device *pdev)
ret = PTR_ERR(m66592->clk);
goto clean_up2;
}
- clk_enable(m66592->clk);
+ ret = clk_enable(m66592->clk);
+ if (ret) {
+ clk_put(m66592->clk);
+ goto clean_up2;
+ }
}
INIT_LIST_HEAD(&m66592->gadget.ep_list);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-12-27 12:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 1:33 [PATCH v2] usb: gadget: m66592-udc: Add check for clk_enable() Mingwei Zheng
2024-12-27 12:08 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox