diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-04-23 20:11:14 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2013-06-14 16:50:17 -0400 |
commit | 92f8e76769c687a7c38c5067ff375c187666ac18 (patch) | |
tree | 47b8efd7542d4e4c4dce5050317cd26fc0fa0602 /drivers/usb/host/xhci-dbg.c | |
parent | 29f9d54b63a6186f1bed3fc15eeab7f98947eebd (diff) |
xhci: Remove BUG_ON in xhci_get_input_control_ctx.
Fail gracefully, instead of causing the kernel to panic, if the input
control context doesn't have the right type (XHCI_CTX_TYPE_INPUT). Push
finding the pointer to the input control context up into functions that
can fail.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: John Youn <johnyoun@synopsys.com>
Diffstat (limited to 'drivers/usb/host/xhci-dbg.c')
-rw-r--r-- | drivers/usb/host/xhci-dbg.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-dbg.c b/drivers/usb/host/xhci-dbg.c index f2e7689e11a3..5d5e58fdeccc 100644 --- a/drivers/usb/host/xhci-dbg.c +++ b/drivers/usb/host/xhci-dbg.c | |||
@@ -553,6 +553,11 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci, | |||
553 | if (ctx->type == XHCI_CTX_TYPE_INPUT) { | 553 | if (ctx->type == XHCI_CTX_TYPE_INPUT) { |
554 | struct xhci_input_control_ctx *ctrl_ctx = | 554 | struct xhci_input_control_ctx *ctrl_ctx = |
555 | xhci_get_input_control_ctx(xhci, ctx); | 555 | xhci_get_input_control_ctx(xhci, ctx); |
556 | if (!ctrl_ctx) { | ||
557 | xhci_warn(xhci, "Could not get input context, bad type.\n"); | ||
558 | return; | ||
559 | } | ||
560 | |||
556 | xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n", | 561 | xhci_dbg(xhci, "@%p (virt) @%08llx (dma) %#08x - drop flags\n", |
557 | &ctrl_ctx->drop_flags, (unsigned long long)dma, | 562 | &ctrl_ctx->drop_flags, (unsigned long long)dma, |
558 | ctrl_ctx->drop_flags); | 563 | ctrl_ctx->drop_flags); |