]> Gentwo Git Trees - linux/.git/commit
staging: gpib: Fix NULL pointer dereference in detach
authorDave Penkler <dpenkler@gmail.com>
Sat, 18 Jan 2025 14:50:45 +0000 (15:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Jan 2025 08:06:30 +0000 (09:06 +0100)
commit6a6c153537f093c3bc79ea9633f3954d3450d0ba
tree963276cb13d761a2cf8920710d0b14ef61918558
parent9ed145e64f0af9a22e95f79940c540affbd939e2
staging: gpib: Fix NULL pointer dereference in detach

When the detach function is called after a failed attach
the usb_dev initialization can cause a NULL pointer
dereference. This happens when the usb device is not found
in the attach procedure.

Remove the usb_dev variable and initialization and change the dev
in the dev_info message from the usb_dev to the gpib_dev.

Fixes: fbae7090f30c ("staging: gpib: Update messaging and usb_device refs in agilent_usb")
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Link: https://lore.kernel.org/r/20250118145046.12181-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/agilent_82357a/agilent_82357a.c