[PATCH] usb: gadget: m66592-udc: Add check for clk_enable()

Mingwei Zheng posted 1 patch 1 year, 1 month ago
There is a newer version of this series
drivers/usb/gadget/udc/m66592-udc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
Posted by Mingwei Zheng 1 year, 1 month ago
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>
---
 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
Re: [PATCH] usb: gadget: m66592-udc: Add check for clk_enable()
Posted by Greg KH 1 year, 1 month ago
On Tue, Dec 24, 2024 at 03:22:17PM -0500, Mingwei Zheng wrote:
> The APP-Miner reported the missing check.

What does this mean?  Please explain it better as the documentation
states you must do when using random research tools.

> 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()")

Why is this only a Fixes tag and not also a cc: stable?  And how did you
test it?

thanks,

greg k-h