Skip to contentSkip to conversation

usb: storage: stop probe on "Invalid device"

PATCH Superseded Janne Grunau 3 participants 4 messages Jul 21, 2022 – Aug 8, 2022

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: storage: stop probe on "Invalid device"

Fixes a crash during probing of sd card readers without medium present.

---
 common/usb_storage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
common/usb_storage.c +1 -3
index eaa31374ef73..5a62d61f4382 100644
@@ -236,9 +236,7 @@ static int usb_stor_probe_device(struct usb_device *udev)
 			debug("%s: Found device %p\n", __func__, udev);
 		} else {
 			debug("usb_stor_get_info: Invalid device\n");
-			ret = device_unbind(dev);
-			if (ret)
-				return ret;
+			return device_unbind(dev);
 		}
 
 		ret = blk_probe_or_unbind(dev);
Signature · 1 line
2.35.1
#2 lore raw

Hi Simon,

Quoted 6 lines · Simon Glass

Hi Marek,

Quoted 3 lines · Janne Grunau

Fixes a crash during probing of sd card readers without medium present.

Quoted 7 lines
Quoted 5 lines
---
 common/usb_storage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

I made this comment on another bug report:
https://lists.denx.de/pipermail/u-boot/2022-July/489717.html

I think we should continue to scan the *bus* even if detecting/activating a specific device fails.

Moreover, we would better do full recovery from blk_create_device(f)() as it has some side-effects, including an increased "devnum".

-Takahiro Akashi

Quoted 4 lines

Shall I pick this one up?

Regards,
Simon

#3 lore raw

Hi Takahiro,

Quoted 9 lines · AKASHI Takahiro

Hi Simon,

Quoted 5 lines · Simon Glass

Hi Marek,

Quoted 2 lines · Janne Grunau

Fixes a crash during probing of sd card readers without medium

present.

Quoted 9 lines
Quoted 8 lines
Quoted 6 lines
---
 common/usb_storage.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 8 lines

I made this comment on another bug report:
https://lists.denx.de/pipermail/u-boot/2022-July/489717.html

I think we should continue to scan the *bus* even if detecting/activating a specific device fails.

Moreover, we would better do full recovery from blk_create_device(f)() as it has some side-effects, including an increased "devnum".

OK I didn't see that. Can you please send an alternative patch?

Quoted 4 lines

-Takahiro Akashi

Quoted 1 line

Shall I pick this one up?

Regards,
Simon