Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wusb: fix error return code in wusb_prf()

Fix to return error code -ENOMEM from the kmalloc() error handling
case instead of 0, as done elsewhere in this function.

Fixes: a19b882c07a6 ("wusb: Stop using the stack for sg crypto scratch space")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
1ee1710c 733cbe06

+3 -1
+3 -1
drivers/usb/wusbcore/crypto.c
··· 339 339 goto error_setkey_aes; 340 340 } 341 341 scratch = kmalloc(sizeof(*scratch), GFP_KERNEL); 342 - if (!scratch) 342 + if (!scratch) { 343 + result = -ENOMEM; 343 344 goto error_alloc_scratch; 345 + } 344 346 345 347 for (bitr = 0; bitr < (len + 63) / 64; bitr++) { 346 348 sfn_le = cpu_to_le64(sfn++);