Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rsi: fix potential null dereference in rsi_probe()
@ 2019-10-02 17:18 Denis Efremov
  2019-10-04 13:47 ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Efremov @ 2019-10-02 17:18 UTC (permalink / raw)
  To: linux-wireless
  Cc: Denis Efremov, netdev, linux-kernel, Amitkumar Karwar,
	Siva Rebbagondla, Kalle Valo

The id pointer can be NULL in rsi_probe(). It is checked everywhere except
for the else branch in the idProduct condition. The patch adds NULL check
before the id dereference in the rsi_dbg() call.

Fixes: 54fdb318c111 ("rsi: add new device model for 9116")
Cc: Amitkumar Karwar <amitkarwar@gmail.com>
Cc: Siva Rebbagondla <siva8118@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Denis Efremov <efremov@linux.com>
---
 drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index 760eaffeebd6..23a1d00b5f38 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -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->idProduct);
+			__func__, id ? id->idProduct : 0x0);
 		goto err1;
 	}
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: fix potential null dereference in rsi_probe()
  2019-10-02 17:18 [PATCH] rsi: fix potential null dereference in rsi_probe() Denis Efremov
@ 2019-10-04 13:47 ` Kalle Valo
  2019-10-04 14:49   ` Johan Hovold
  0 siblings, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2019-10-04 13:47 UTC (permalink / raw)
  To: Denis Efremov
  Cc: linux-wireless, Denis Efremov, netdev, linux-kernel,
	Amitkumar Karwar, Siva Rebbagondla

Denis Efremov <efremov@linux.com> wrote:

> The id pointer can be NULL in rsi_probe(). It is checked everywhere except
> for the else branch in the idProduct condition. The patch adds NULL check
> before the id dereference in the rsi_dbg() call.
> 
> Fixes: 54fdb318c111 ("rsi: add new device model for 9116")
> Cc: Amitkumar Karwar <amitkarwar@gmail.com>
> Cc: Siva Rebbagondla <siva8118@gmail.com>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Signed-off-by: Denis Efremov <efremov@linux.com>

Patch applied to wireless-drivers-next.git, thanks.

f170d44bc4ec rsi: fix potential null dereference in rsi_probe()

-- 
https://patchwork.kernel.org/patch/11171695/

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: fix potential null dereference in rsi_probe()
  2019-10-04 13:47 ` Kalle Valo
@ 2019-10-04 14:49   ` Johan Hovold
  2019-10-06  8:22     ` Kalle Valo
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Hovold @ 2019-10-04 14:49 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Denis Efremov, linux-wireless, netdev, linux-kernel,
	Amitkumar Karwar, Siva Rebbagondla

On Fri, Oct 04, 2019 at 01:47:36PM +0000, Kalle Valo wrote:
> Denis Efremov <efremov@linux.com> wrote:
> 
> > The id pointer can be NULL in rsi_probe().

While the existing code in rsi_probe() may lead you to believe that,
this statement is false. 

> > It is checked everywhere except
> > for the else branch in the idProduct condition. The patch adds NULL check
> > before the id dereference in the rsi_dbg() call.
> > 
> > Fixes: 54fdb318c111 ("rsi: add new device model for 9116")
> > Cc: Amitkumar Karwar <amitkarwar@gmail.com>
> > Cc: Siva Rebbagondla <siva8118@gmail.com>
> > Cc: Kalle Valo <kvalo@codeaurora.org>
> > Signed-off-by: Denis Efremov <efremov@linux.com>
> 
> Patch applied to wireless-drivers-next.git, thanks.
> 
> f170d44bc4ec rsi: fix potential null dereference in rsi_probe()

I just sent a revert to prevent the confusion from spreading (e.g. to
stable autosel and contributers looking for things to work on). Hope you
don't mind, Kalle.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rsi: fix potential null dereference in rsi_probe()
  2019-10-04 14:49   ` Johan Hovold
@ 2019-10-06  8:22     ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-10-06  8:22 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Denis Efremov, linux-wireless, netdev, linux-kernel,
	Amitkumar Karwar, Siva Rebbagondla

Johan Hovold <johan@kernel.org> writes:

> On Fri, Oct 04, 2019 at 01:47:36PM +0000, Kalle Valo wrote:
>> Denis Efremov <efremov@linux.com> wrote:
>> 
>> > The id pointer can be NULL in rsi_probe().
>
> While the existing code in rsi_probe() may lead you to believe that,
> this statement is false. 
>
>> > It is checked everywhere except
>> > for the else branch in the idProduct condition. The patch adds NULL check
>> > before the id dereference in the rsi_dbg() call.
>> > 
>> > Fixes: 54fdb318c111 ("rsi: add new device model for 9116")
>> > Cc: Amitkumar Karwar <amitkarwar@gmail.com>
>> > Cc: Siva Rebbagondla <siva8118@gmail.com>
>> > Cc: Kalle Valo <kvalo@codeaurora.org>
>> > Signed-off-by: Denis Efremov <efremov@linux.com>
>> 
>> Patch applied to wireless-drivers-next.git, thanks.
>> 
>> f170d44bc4ec rsi: fix potential null dereference in rsi_probe()
>
> I just sent a revert to prevent the confusion from spreading (e.g. to
> stable autosel and contributers looking for things to work on). Hope you
> don't mind, Kalle.

That's great, thanks Johan.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 17:18 [PATCH] rsi: fix potential null dereference in rsi_probe() Denis Efremov
2019-10-04 13:47 ` Kalle Valo
2019-10-04 14:49   ` Johan Hovold
2019-10-06  8:22     ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org linux-wireless@archiver.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/ public-inbox