summaryrefslogtreecommitdiffstats
path: root/drivers/usb/early
diff options
context:
space:
mode:
authorPan Bian2016-11-29 13:55:12 +0100
committerGreg Kroah-Hartman2016-11-29 17:36:43 +0100
commitcd63a1c1952e169b788ee3ee2a064546ca325ea0 (patch)
treeab0d6b8541211c45b8fa28fd65a3bd6c230bbe80 /drivers/usb/early
parentusb: return correct errno code when krealloc fails (diff)
downloadkernel-qcow2-linux-cd63a1c1952e169b788ee3ee2a064546ca325ea0.tar.gz
kernel-qcow2-linux-cd63a1c1952e169b788ee3ee2a064546ca325ea0.tar.xz
kernel-qcow2-linux-cd63a1c1952e169b788ee3ee2a064546ca325ea0.zip
usb: return correct errno on failures
In function __wa_xfer_setup_segs(), variable result takes the return value. Its value should be a negative errno on failures. Because result may be reassigned in a loop, and its value is guaranteed to be not less than 0 during the following repeats of the loop. So when the call to kmalloc() or usb_alloc_urb() fails in the loop, the value of variable result may be 0 (indicates no error), which is inconsistent with the execution status. This patch fixes the bug, initializing variable result with -ENOMEM in the loop. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/early')
0 files changed, 0 insertions, 0 deletions