diff options
| author | Andrew Goodbody <[email protected]> | 2025-09-29 10:11:57 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2025-09-30 11:55:23 +0200 |
| commit | 8cd4a5e94ba2ab73fde3301d6314549dd5a25cb4 (patch) | |
| tree | 312cd6bbce29a8a8cdd5b0ba2c1a48eee17309f5 | |
| parent | 5ac61383b2db15b037e87bd353f726eafc49e181 (diff) | |
usb: dwc3: Remove redundant test
In dwc3_ep0_complete_data there is a test for 'r' being null and the
code will return at that point if so. After that point 'r' is guaranteed
to not be null and testing for that is redundant. Remove the test for
'r' being non-null.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <[email protected]>
Reviewed-by: Mattijs Korpershoek <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mattijs Korpershoek <[email protected]>
| -rw-r--r-- | drivers/usb/dwc3/ep0.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index c656cbe25ce..680756532f0 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -799,10 +799,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, status = DWC3_TRB_SIZE_TRBSTS(trb->size); if (status == DWC3_TRBSTS_SETUP_PENDING) { dev_dbg(dwc->dev, "Setup Pending received"); - - if (r) - dwc3_gadget_giveback(ep0, r, -ECONNRESET); - + dwc3_gadget_giveback(ep0, r, -ECONNRESET); return; } |
