Thread (9 messages) 9 messages, 3 authors, 2013-10-15

[PATCH v2 1/3] usb: musb: Handle nullpointer

flat view
STALE4752d SUPERSEDED

From: Markus Pargmann <hidden>
Date: 2013-10-14 13:50:37
Subsystem: musb multipoint high speed dual-role controller, the rest, usb subsystem · Maintainers: Bin Liu, Linus Torvalds, Greg Kroah-Hartman

Revision v2 of 9 in this series.

Revisions (9)
  1. v1 [diff vs current]
  2. v2 current
  3. v2
  4. v2
  5. v2
  6. v2
  7. v3 [diff vs current]
  8. v3 [diff vs current]
  9. v3 [diff vs current]
When the device is connected to a host without a gadget driver,
otg->gadget is NULL.

Signed-off-by: Markus Pargmann <redacted>
---
 drivers/usb/musb/musb_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 18e877f..baa4f6a 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -654,7 +654,8 @@ static irqreturn_t musb_stage0_irq(struct musb *musb, u8 int_usb,
 				break;
 		case OTG_STATE_B_PERIPHERAL:
 			musb_g_suspend(musb);
-			musb->is_active = otg->gadget->b_hnp_enable;
+			musb->is_active = otg->gadget &&
+					otg->gadget->b_hnp_enable;
 			if (musb->is_active) {
 				musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
 				dev_dbg(musb->controller, "HNP: Setting timer for b_ase0_brst\n");
-- 
1.8.4.rc3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help