aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVardan Mikayelyan <mvardan@synopsys.com>2016-04-27 23:20:51 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-04-28 02:41:12 -0400
commitb0d659022e5c96ee5c4bd62d22d3da2d66de306b (patch)
tree78eab31ee45240d425a627de6b81293e6b8492d2
parentee3de8d750134703c702534173cd8623d1b32c38 (diff)
usb: dwc2: host: Setting qtd to NULL after freeing it
This is safety change added while doing slub debugging. Affected functions: dwc2_hcd_qtd_unlink_and_free() _dwc2_hcd_urb_enqueue() Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc2/hcd.c1
-rw-r--r--drivers/usb/dwc2/hcd.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 1f6255131857..2df3d04d26f5 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -4703,6 +4703,7 @@ fail2:
4703 spin_unlock_irqrestore(&hsotg->lock, flags); 4703 spin_unlock_irqrestore(&hsotg->lock, flags);
4704 urb->hcpriv = NULL; 4704 urb->hcpriv = NULL;
4705 kfree(qtd); 4705 kfree(qtd);
4706 qtd = NULL;
4706fail1: 4707fail1:
4707 if (qh_allocated) { 4708 if (qh_allocated) {
4708 struct dwc2_qtd *qtd2, *qtd2_tmp; 4709 struct dwc2_qtd *qtd2, *qtd2_tmp;
diff --git a/drivers/usb/dwc2/hcd.h b/drivers/usb/dwc2/hcd.h
index 89fa26cb25f4..7758bfb644ff 100644
--- a/drivers/usb/dwc2/hcd.h
+++ b/drivers/usb/dwc2/hcd.h
@@ -552,6 +552,7 @@ static inline void dwc2_hcd_qtd_unlink_and_free(struct dwc2_hsotg *hsotg,
552{ 552{
553 list_del(&qtd->qtd_list_entry); 553 list_del(&qtd->qtd_list_entry);
554 kfree(qtd); 554 kfree(qtd);
555 qtd = NULL;
555} 556}
556 557
557/* Descriptor DMA support functions */ 558/* Descriptor DMA support functions */