aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorJohn Youn <johnyoun@synopsys.com>2016-02-29 20:53:35 -0500
committerFelipe Balbi <balbi@kernel.org>2016-03-04 08:14:48 -0500
commit1fc659894994c7faa67e51a4b5a981ab4cf0f3a5 (patch)
tree56a9fda3a070f11fbc6dfa3ba1936dc5d63d79d4 /drivers/usb/dwc2
parent6c0c0951bbf8c2c216675fe277fba4c42aa0a2bf (diff)
usb: dwc2: Fix issues in dwc2_complete_non_isoc_xfer_ddma()
Fixes a static analysis issue in dwc2_complete_non_isoc_xfer_ddma(). The qtd was being passed to a function after being freed. It was not being used in the function so this doesn't fix any bugs. But it fixes up the warning and makes the code safer by setting qtd to NULL and not using it at all. Reported-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/hcd_ddma.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/hcd_ddma.c b/drivers/usb/dwc2/hcd_ddma.c
index 27350d0b1c50..0e1d42b5dec5 100644
--- a/drivers/usb/dwc2/hcd_ddma.c
+++ b/drivers/usb/dwc2/hcd_ddma.c
@@ -1245,8 +1245,10 @@ static void dwc2_complete_non_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
1245 for (i = 0; i < qtd_desc_count; i++) { 1245 for (i = 0; i < qtd_desc_count; i++) {
1246 if (dwc2_process_non_isoc_desc(hsotg, chan, chnum, qtd, 1246 if (dwc2_process_non_isoc_desc(hsotg, chan, chnum, qtd,
1247 desc_num, halt_status, 1247 desc_num, halt_status,
1248 &xfer_done)) 1248 &xfer_done)) {
1249 qtd = NULL;
1249 goto stop_scan; 1250 goto stop_scan;
1251 }
1250 1252
1251 desc_num++; 1253 desc_num++;
1252 } 1254 }
@@ -1261,7 +1263,7 @@ stop_scan:
1261 if (halt_status == DWC2_HC_XFER_STALL) 1263 if (halt_status == DWC2_HC_XFER_STALL)
1262 qh->data_toggle = DWC2_HC_PID_DATA0; 1264 qh->data_toggle = DWC2_HC_PID_DATA0;
1263 else 1265 else
1264 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, qtd); 1266 dwc2_hcd_save_data_toggle(hsotg, chan, chnum, NULL);
1265 } 1267 }
1266 1268
1267 if (halt_status == DWC2_HC_XFER_COMPLETE) { 1269 if (halt_status == DWC2_HC_XFER_COMPLETE) {