Skip to contentSkip to conversation

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

PATCH In review Mingwei Zheng 2 participants 2 messages Dec 26, 2024 – Dec 27, 2024 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: gadget: m66592-udc: Add check for clk_enable()

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

---
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(-)
drivers/usb/gadget/udc/m66592-udc.c +5 -1
index a938b2af0944..bf408476a24c 100644
@@ -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);
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 3 lines · Mingwei Zheng

The APP-Miner reported the missing check.
Add check for the return value of clk_enable() to catch the potential error.

Again, please read ./Documentation/process/researcher-guidelines.rst and follow it.

thanks,

gre k-h