Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7902c16b authored by Paul Zimmerman's avatar Paul Zimmerman Committed by Greg Kroah-Hartman
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent de9169a1
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1377,10 +1377,9 @@ 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,
			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);