Commit 4dce3b37 authored by Jack Wang's avatar Jack Wang Committed by Greg Kroah-Hartman

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: default avatarJack Wang <jinpu.wang@ionos.com>
Link: https://lore.kernel.org/r/20220819060801.10443-7-jinpu.wang@ionos.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a88520bf
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment