Skip to contentSkip to conversation

Revert "rsi: fix potential null dereference in rsi_probe()"

PATCH In review Johan Hovold 2 participants 7 messages Oct 4, 2019 – Oct 9, 2019

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 2/2 rsi: drop bogus device-id checks from probe

In reply to Johan Hovold

USB core will never call a USB-driver probe function with a NULL device-id pointer.

---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +2 -2
index 760eaffeebd6..53f41fc2cadf 100644
@@ -785,10 +785,10 @@ static int rsi_probe(struct usb_interface *pfunction,
 
 	rsi_dbg(ERR_ZONE, "%s: Initialized os intf ops\n", __func__);
 
-	if (id && id->idProduct == RSI_USB_PID_9113) {
+	if (id->idProduct == RSI_USB_PID_9113) {
 		rsi_dbg(INIT_ZONE, "%s: 9113 module detected\n", __func__);
 		adapter->device_model = RSI_DEV_9113;
-	} else if (id && id->idProduct == RSI_USB_PID_9116) {
+	} else if (id->idProduct == RSI_USB_PID_9116) {
 		rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__);
 		adapter->device_model = RSI_DEV_9116;
 	} else {
Signature · 1 line
2.23.0
#0 lore raw

PATCH 1/2 Revert "rsi: fix potential null dereference in rsi_probe()"

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_usb.c +1 -1
index 23a1d00b5f38..760eaffeebd6 100644
@@ -793,7 +793,7 @@ static int rsi_probe(struct usb_interface *pfunction,
 		adapter->device_model = RSI_DEV_9116;
 	} else {
 		rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n",
-			__func__, id ? id->idProduct : 0x0);
+			__func__, id->idProduct);
 		goto err1;
 	}
 
Signature · 1 line
2.23.0
#2 lore raw
Quoted 9 lines · Johan Hovold

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

I'll queue these two to v5.4.

Signature · 1 line
Kalle Valo
#3 lore raw
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johan Hovold

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Quoted 6 lines
Quoted 4 lines

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

I'll queue these two to v5.4.

Actually I'll take that back. Commit f170d44bc4ec is in -next so I have to also queue these to -next.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw
Quoted 12 lines · Kalle Valo
Quoted 10 lines · Kalle Valo
Quoted 8 lines · Johan Hovold

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I'll queue these two to v5.4.

Actually I'll take that back. Commit f170d44bc4ec is in -next so I have to also queue these to -next.

That's right. I'm assuming you don't rebase your branches, otherwise just dropping the offending patch might of course be an option instead of the revert.

Johan

#5 lore raw
Quoted 15 lines · Johan Hovold
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Kalle Valo
Quoted 9 lines · Johan Hovold

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I'll queue these two to v5.4.

Actually I'll take that back. Commit f170d44bc4ec is in -next so I have to also queue these to -next.

That's right. I'm assuming you don't rebase your branches, otherwise just dropping the offending patch might of course be an option instead of the revert.

Yeah, I don't rebase my trees so we have to do a revert.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#6 lore raw
In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

This reverts commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0.

USB core will never call a USB-driver probe function with a NULL device-id pointer.

Reverting before removing the existing checks in order to document this and prevent the offending commit from being "autoselected" for stable.

2 patches applied to wireless-drivers-next.git, thanks.

c5dcf8f0e850 Revert "rsi: fix potential null dereference in rsi_probe()" 39e50f5ce26c rsi: drop bogus device-id checks from probe

Signature · 3 lines
https://patchwork.kernel.org/patch/11174711/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches