[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220819060801.10443-7-jinpu.wang@ionos.com>
Date: Fri, 19 Aug 2022 08:07:48 +0200
From: Jack Wang <jinpu.wang@...os.com>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Kishon Vijay Abraham I <kishon@...com>,
Alexey Sheplyakov <asheplyakov@...ealt.ru>,
Stephen Boyd <swboyd@...omium.org>,
Weitao Wang <WeitaoWang-oc@...oxin.com>,
Matthias Kaehlcke <mka@...omium.org>,
Arnd Bergmann <arnd@...db.de>, linux-usb@...r.kernel.org
Subject: [PATCH v1 06/19] usb/hcd: Fix dma_map_sg error check
dma_map_sg return 0 on error.
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: Kishon Vijay Abraham I <kishon@...com>
Cc: Alexey Sheplyakov <asheplyakov@...ealt.ru>
Cc: Stephen Boyd <swboyd@...omium.org>
Cc: Weitao Wang <WeitaoWang-oc@...oxin.com>
Cc: Matthias Kaehlcke <mka@...omium.org>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: linux-usb@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Jack Wang <jinpu.wang@...os.com>
---
drivers/usb/core/hcd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 94b305bbd621..90dd32a24e5b 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1474,7 +1474,7 @@ int usb_hcd_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
urb->sg,
urb->num_sgs,
dir);
- if (n <= 0)
+ if (!n)
ret = -EAGAIN;
else
urb->transfer_flags |= URB_DMA_MAP_SG;
--
2.34.1
Powered by blists - more mailing lists