summaryrefslogtreecommitdiff
path: root/drivers/usb/core
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@ionos.com>2022-08-19 08:07:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-19 11:10:23 +0200
commit4dce3b375179fdd4aba2191be11ace90ef0ec6d6 (patch)
tree3f88c73333ca40c7a13934b45b0d6dbd725cb87b /drivers/usb/core
parenta88520bfc0ec829973f92b7a1ab0f64eb9a20724 (diff)
downloadlinux-next-4dce3b375179fdd4aba2191be11ace90ef0ec6d6.tar.gz
usb/hcd: Fix dma_map_sg error check
dma_map_sg return 0 on error. Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Kishon Vijay Abraham I <kishon@ti.com> Cc: Alexey Sheplyakov <asheplyakov@basealt.ru> Cc: Stephen Boyd <swboyd@chromium.org> Cc: Weitao Wang <WeitaoWang-oc@zhaoxin.com> Cc: Matthias Kaehlcke <mka@chromium.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Link: https://lore.kernel.org/r/20220819060801.10443-7-jinpu.wang@ionos.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core')
-rw-r--r--drivers/usb/core/hcd.c2
1 files changed, 1 insertions, 1 deletions
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;