[PATCH] usb: musb: dsps: fix error return code in dsps_create_musb_pdev()

Wei Yongjun weiyj.lk at gmail.com
Tue May 7 21:47:44 EST 2013


From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>

Fix to return -ENOMEM in the devm_kzalloc() error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
---
 drivers/usb/musb/musb_dsps.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 3a18e44..e1b661d 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -560,6 +560,7 @@ static int dsps_create_musb_pdev(struct dsps_glue *glue, u8 id)
 		if (!config) {
 			dev_err(&pdev->dev,
 				"failed to allocate musb hdrc config\n");
+			ret = -ENOMEM;
 			goto err2;
 		}
 



More information about the devicetree-discuss mailing list