mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
USB: storage: ums-realtek: fix error code in rts51x_read_mem()
The rts51x_read_mem() function should return negative error codes.
Currently if the kmalloc() fails it returns USB_STOR_TRANSPORT_ERROR (3)
which is treated as success by the callers.
Fixes: 065e60964e
("ums_realtek: do not use stack memory for DMA")
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220304073504.GA26464@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
298ac860af
commit
b07cabb836
@ -365,7 +365,7 @@ static int rts51x_read_mem(struct us_data *us, u16 addr, u8 *data, u16 len)
|
||||
|
||||
buf = kmalloc(len, GFP_NOIO);
|
||||
if (buf == NULL)
|
||||
return USB_STOR_TRANSPORT_ERROR;
|
||||
return -ENOMEM;
|
||||
|
||||
usb_stor_dbg(us, "addr = 0x%x, len = %d\n", addr, len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user