]> www.infradead.org Git - users/jedix/linux-maple.git/commit
staging: gpib: Fix Oops after disconnect in agilent usb
authorDave Penkler <dpenkler@gmail.com>
Sat, 22 Feb 2025 20:45:15 +0000 (21:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Mar 2025 13:54:35 +0000 (06:54 -0700)
commit8491e73a5223acb0a4b4d78c3f8b96aa9c5e774d
treec85374899bdc31b3de2b2883381a834a368d39fb
parenta239c6e91b665f1837cf57b97fe638ef1baf2e78
staging: gpib: Fix Oops after disconnect in agilent usb

If the agilent usb dongle is disconnected subsequent calls to the
driver cause a NULL dereference Oops as the bus_interface
is set to NULL on disconnect.

This problem was introduced by setting usb_dev from the bus_interface
for dev_xxx messages.

Previously bus_interface was checked for NULL only in the functions
directly calling usb_fill_bulk_urb or usb_control_msg.

Check for valid bus_interface on all interface entry points
and return -ENODEV if it is NULL.

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