]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
rsi: fix potential null dereference in rsi_probe()
authorDenis Efremov <efremov@linux.com>
Wed, 2 Oct 2019 17:18:11 +0000 (20:18 +0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 30 Jan 2020 15:25:00 +0000 (16:25 +0100)
BugLink: https://bugs.launchpad.net/bugs/1861085
commit f170d44bc4ec2feae5f6206980e7ae7fbf0432a0 upstream.

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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/wireless/rsi/rsi_91x_usb.c

index 760eaffeebd64a100392f5d97da43ae303428520..23a1d00b5f38c0212f0578c9a0a0592268af4880 100644 (file)
@@ -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;
        }