提交 1ee1710c 编写于 作者: W Wei Yongjun 提交者: Greg Kroah-Hartman

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: a19b882c ("wusb: Stop using the stack for sg crypto scratch space")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 733cbe06
......@@ -339,8 +339,10 @@ ssize_t wusb_prf(void *out, size_t out_size,
goto error_setkey_aes;
}
scratch = kmalloc(sizeof(*scratch), GFP_KERNEL);
if (!scratch)
if (!scratch) {
result = -ENOMEM;
goto error_alloc_scratch;
}
for (bitr = 0; bitr < (len + 63) / 64; bitr++) {
sfn_le = cpu_to_le64(sfn++);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册