提交 7902c16b 编写于 作者: P Paul Zimmerman 提交者: Greg Kroah-Hartman

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 de9169a1
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册