[PATCH 2/2] usb/dummy_hcd: don't probe for udc if hcd failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the_controller is allocated in dummy_hcd_probe() is NULL if it failed.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
 drivers/usb/gadget/dummy_hcd.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 3214ca3..a7aacf9 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -874,6 +874,8 @@ static int dummy_udc_probe (struct platform_device *pdev)
 	struct dummy	*dum = the_controller;
 	int		rc;
 
+	if (!dum)
+		return -ENODEV;
 	usb_get_hcd(dummy_to_hcd(dum));
 
 	dum->gadget.name = gadget_name;
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux