Skip to content
Commit 7faf44bf authored by Pan Bian's avatar Pan Bian Committed by Greg Kroah-Hartman
Browse files

usb: fix improper return value when kzalloc fails



The comment says function wa_nep_queue() should return 0 if ok, and <0
errno code on error. However, its implementation always returns 0, even
if the call to kzalloc() fails. As a result, the return value may be
inconsistent with the execution status, which may mislead the callers.
This patch fixes the bug, returning -ENOMEM when the call to kzalloc()
fails.

Signed-off-by: default avatarPan Bian <bianpan2016@163.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cd63a1c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment