OpenCloudOS-Kernel/drivers/usb/storage
Shichao Lai 2cc32639ec usb-storage: alauda: Check whether the media is initialized
[ Upstream commit 16637fea001ab3c8df528a8995b3211906165a30 ]

The member "uzonesize" of struct alauda_info will remain 0
if alauda_init_media() fails, potentially causing divide errors
in alauda_read_data() and alauda_write_lba().
- Add a member "media_initialized" to struct alauda_info.
- Change a condition in alauda_check_media() to ensure the
  first initialization.
- Add an error check for the return value of alauda_init_media().

Fixes: e80b0fade0 ("[PATCH] USB Storage: add alauda support")
Reported-by: xingwei lee <xrivendell7@gmail.com>
Reported-by: yue sun <samsun1006219@gmail.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Shichao Lai <shichaorai@gmail.com>
Link: https://lore.kernel.org/r/20240526012745.2852061-1-shichaorai@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-21 14:38:49 +02:00
..
Kconfig
Makefile
alauda.c usb-storage: alauda: Check whether the media is initialized 2024-06-21 14:38:49 +02:00
cypress_atacb.c
datafab.c
debug.c
debug.h
ene_ub6250.c
freecom.c
initializers.c
initializers.h
isd200.c USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command 2024-04-03 15:28:42 +02:00
jumpshot.c
karma.c
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c
scsiglue.c scsi: sd: usb_storage: uas: Access media prior to querying device properties 2024-03-01 13:34:59 +01:00
scsiglue.h
sddr09.c
sddr55.c
shuttle_usbat.c
sierra_ms.c
sierra_ms.h
transport.c
transport.h
uas-detect.h
uas.c USB: UAS: return ENODEV when submit urbs fail with device not attached 2024-04-03 15:28:58 +02:00
unusual_alauda.h
unusual_cypress.h usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility 2023-11-08 11:56:22 +01:00
unusual_datafab.h
unusual_devs.h usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3 2024-01-01 12:42:38 +00:00
unusual_ene_ub6250.h
unusual_freecom.h
unusual_isd200.h
unusual_jumpshot.h
unusual_karma.h
unusual_onetouch.h
unusual_realtek.h
unusual_sddr09.h
unusual_sddr55.h
unusual_uas.h
unusual_usbat.h
usb.c
usb.h
usual-tables.c