USB: storage: ums-realtek: fix error code in rts51x_read_mem()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Mar 2022 07:35:04 +0000 (10:35 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:40 +0000 (14:23 +0200)
commit5d48ddbcafdf69bb757c3f3fc1983284ae351a5b
treea06f6f90ffccf889fbfbe7b2370128460e825e97
parentbc2c4dc5b566662193fe3f76b941bb3b1257c44f
USB: storage: ums-realtek: fix error code in rts51x_read_mem()

[ Upstream commit b07cabb8361dc692522538205552b1b9dab134be ]

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: 065e60964e29 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/storage/realtek_cr.c