diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2013-04-22 14:00:18 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-23 10:37:55 -0700 |
commit | 7902c16b9a5b7001d79940d6b4e99366d6e525d8 (patch) | |
tree | 803c97fe196b0b332b98004ec7cecfd6bc202a4f /drivers | |
parent | de9169a1e026245b2efcc0fa8723d5fe5580de0b (diff) | |
download | linux-7902c16b9a5b7001d79940d6b4e99366d6e525d8.tar.bz2 |
staging: dwc2: check for null pointer before dereferencing it
We were testing qtd->urb pointer for null after we had already
dereferenced it
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/dwc2/hcd_intr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/staging/dwc2/hcd_intr.c b/drivers/staging/dwc2/hcd_intr.c index a8d8c53a8b23..6e5dbed6ccec 100644 --- a/drivers/staging/dwc2/hcd_intr.c +++ b/drivers/staging/dwc2/hcd_intr.c @@ -1377,13 +1377,12 @@ static void dwc2_hc_nyet_intr(struct dwc2_hsotg *hsotg, hsotg->core_params->dma_enable > 0) { qtd->complete_split = 0; qtd->isoc_split_offset = 0; - if (++qtd->isoc_frame_index == qtd->urb->packet_count) { - if (qtd->urb) - dwc2_host_complete(hsotg, - qtd->urb->priv, - qtd->urb, 0); + if (qtd->urb && + ++qtd->isoc_frame_index == qtd->urb->packet_count) { + dwc2_host_complete(hsotg, qtd->urb->priv, + qtd->urb, 0); dwc2_release_channel(hsotg, chan, qtd, - DWC2_HC_XFER_URB_COMPLETE); + DWC2_HC_XFER_URB_COMPLETE); } else { dwc2_release_channel(hsotg, chan, qtd, DWC2_HC_XFER_NO_HALT_STATUS); |