WSL2-Linux-Kernel/drivers/usb/storage
Shichao Lai 3eee13ab67 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-07-05 09:14:23 +02:00
..
Kconfig
Makefile
alauda.c usb-storage: alauda: Check whether the media is initialized 2024-07-05 09:14:23 +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-10 16:18:45 +02:00
jumpshot.c
karma.c
onetouch.c
option_ms.c
option_ms.h
protocol.c
protocol.h
realtek_cr.c
scsiglue.c scsi: usb: Call scsi_done() directly 2024-04-10 16:19:34 +02: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-10 16:19:35 +02:00
unusual_alauda.h
unusual_cypress.h
unusual_datafab.h
unusual_devs.h
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 scsi: usb: Call scsi_done() directly 2024-04-10 16:19:34 +02:00
usb.h
usual-tables.c