<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/staging, branch linux-6.13.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>staging: gpib: Fix Oops after disconnect in agilent usb</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-02-22T20:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e88633705078f40391a9afc6cc8ea3025e6f692b'/>
<id>e88633705078f40391a9afc6cc8ea3025e6f692b</id>
<content type='text'>
[ Upstream commit 8491e73a5223acb0a4b4d78c3f8b96aa9c5e774d ]

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 &lt;stable@kernel.org&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250222204515.5104-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 8491e73a5223acb0a4b4d78c3f8b96aa9c5e774d ]

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 &lt;stable@kernel.org&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250222204515.5104-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: agilent usb console messaging cleanup</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-02-14T11:46:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=eae89989242648de18dcc6ecb609d890521374cc'/>
<id>eae89989242648de18dcc6ecb609d890521374cc</id>
<content type='text'>
[ Upstream commit 50a6ed0494bc082227c38f427b40731bca9bdf15 ]

Enable module name to be printed in pr_xxx and dev_xxx
Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded
string in usb_driver struct.

Remove __func__ parameter in dev_dbg messages as this can be
enabled with dynamic debug.

Remove __func__ parameter in dev_err messages as they are not
needed. The module name is sufficient.

Change pr_info to dev_dbg where needed and remove the rest
where possible.

Remove test and error messages for buffer over run in write and
read_registers as these are just trying to catch bugs in the driver.

Remove agilent_82357a string prefix in error messages.

Return -EIO for too many reads in read_registers instead of
continuing after printing an error message.

Change pr_warn to dev_warn.

Remove warning on calls for unsupported functionality.

Remove test and message for buffer overflow in agilent_82357_init
and agilent_82357a_go_idle which are just checking for a driver bug.
Use actual indeces in the array instead of i and then incrementing
i so that the code is clear and there is no need to check for
overflow or print a message.

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250214114708.28947-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 50a6ed0494bc082227c38f427b40731bca9bdf15 ]

Enable module name to be printed in pr_xxx and dev_xxx
Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded
string in usb_driver struct.

Remove __func__ parameter in dev_dbg messages as this can be
enabled with dynamic debug.

Remove __func__ parameter in dev_err messages as they are not
needed. The module name is sufficient.

Change pr_info to dev_dbg where needed and remove the rest
where possible.

Remove test and error messages for buffer over run in write and
read_registers as these are just trying to catch bugs in the driver.

Remove agilent_82357a string prefix in error messages.

Return -EIO for too many reads in read_registers instead of
continuing after printing an error message.

Change pr_warn to dev_warn.

Remove warning on calls for unsupported functionality.

Remove test and message for buffer overflow in agilent_82357_init
and agilent_82357a_go_idle which are just checking for a driver bug.
Use actual indeces in the array instead of i and then incrementing
i so that the code is clear and there is no need to check for
overflow or print a message.

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250214114708.28947-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: Agilent usb code cleanup</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-01-18T14:50:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d2dc75c6c9540bd2e592ab5ac6fcc678839510fe'/>
<id>d2dc75c6c9540bd2e592ab5ac6fcc678839510fe</id>
<content type='text'>
[ Upstream commit 579b6f18c5ca162af040f44684cc55f7da182236 ]

Remove useless #ifdef RESET_USB_CONFIG code.

Change kalloc / memset to kzalloc

The attach function was not freeing the private data on error
returns. Separate the releasing of urbs and private data and
add a common error exit for attach failure.

Set the board private data pointer to NULL after freeing
the private data.

Reduce console spam by emitting only one attach message.

Change last pr_err in attach to dev_err

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250118145046.12181-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 579b6f18c5ca162af040f44684cc55f7da182236 ]

Remove useless #ifdef RESET_USB_CONFIG code.

Change kalloc / memset to kzalloc

The attach function was not freeing the private data on error
returns. Separate the releasing of urbs and private data and
add a common error exit for attach failure.

Set the board private data pointer to NULL after freeing
the private data.

Reduce console spam by emitting only one attach message.

Change last pr_err in attach to dev_err

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250118145046.12181-3-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: Fix NULL pointer dereference in detach</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-01-18T14:50:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=09a18f06a58030d4a8b3320fe02d72c2b461a20c'/>
<id>09a18f06a58030d4a8b3320fe02d72c2b461a20c</id>
<content type='text'>
[ Upstream commit 6a6c153537f093c3bc79ea9633f3954d3450d0ba ]

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 &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250118145046.12181-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 6a6c153537f093c3bc79ea9633f3954d3450d0ba ]

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 &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250118145046.12181-2-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: Add missing mutex unlock in agilent usb driver</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-01-11T16:14:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=448b057cbb48eae71fa87c885b9f83e73f74f5af'/>
<id>448b057cbb48eae71fa87c885b9f83e73f74f5af</id>
<content type='text'>
[ Upstream commit 55eb3c3a6388420afda1374b353717de32ae9573 ]

When no matching product id was found in the attach function the driver
returned without unlocking the agilent_82357a_hotplug_lock mutex.

Add the unlock call.

This was detected by smatch:
smatch warnings:
drivers/staging/gpib/agilent_82357a/agilent_82357a.c:1381 agilent_82357a_attach() warn: inconsistent returns 'global &amp;agilent_82357a_hotplug_lock'.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Closes: https://lore.kernel.org/r/202412210143.WJhYzXfD-lkp@intel.com/
Fixes: 4c41fe886a56 ("staging: gpib: Add Agilent/Keysight 82357x USB GPIB driver")
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250111161457.27556-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 55eb3c3a6388420afda1374b353717de32ae9573 ]

When no matching product id was found in the attach function the driver
returned without unlocking the agilent_82357a_hotplug_lock mutex.

Add the unlock call.

This was detected by smatch:
smatch warnings:
drivers/staging/gpib/agilent_82357a/agilent_82357a.c:1381 agilent_82357a_attach() warn: inconsistent returns 'global &amp;agilent_82357a_hotplug_lock'.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Closes: https://lore.kernel.org/r/202412210143.WJhYzXfD-lkp@intel.com/
Fixes: 4c41fe886a56 ("staging: gpib: Add Agilent/Keysight 82357x USB GPIB driver")
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250111161457.27556-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: agilent_82357a: Handle gpib_register_driver() errors</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Nihar Chaithanya</name>
<email>niharchaithanya@gmail.com</email>
</author>
<published>2024-12-30T18:56:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9614796561f8eebf528b852667e3539a54a300dd'/>
<id>9614796561f8eebf528b852667e3539a54a300dd</id>
<content type='text'>
[ Upstream commit 9e43ebc613e2adb9b9e900e11a4099e104b61f2d ]

The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.

In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err when registering driver
fails also indicating the error value.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-4-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 9e43ebc613e2adb9b9e900e11a4099e104b61f2d ]

The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.

In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err when registering driver
fails also indicating the error value.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-4-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: 8491e73a5223 ("staging: gpib: Fix Oops after disconnect in agilent usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: Fix Oops after disconnect in ni_usb</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-02-22T16:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b2d8d7959077c5d4b11d0dc6bd2167791fd1c72e'/>
<id>b2d8d7959077c5d4b11d0dc6bd2167791fd1c72e</id>
<content type='text'>
[ Upstream commit a239c6e91b665f1837cf57b97fe638ef1baf2e78 ]

If the 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 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: 4934b98bb243 ("staging: gpib: Update messaging and usb_device refs in ni_usb")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250222165817.12856-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit a239c6e91b665f1837cf57b97fe638ef1baf2e78 ]

If the 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 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: 4934b98bb243 ("staging: gpib: Update messaging and usb_device refs in ni_usb")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250222165817.12856-1-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: ni_usb console messaging cleanup</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Dave Penkler</name>
<email>dpenkler@gmail.com</email>
</author>
<published>2025-02-14T11:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=79f348c32f3594ca839557cea884a01f3a6578b1'/>
<id>79f348c32f3594ca839557cea884a01f3a6578b1</id>
<content type='text'>
[ Upstream commit 18ce5b5d9167bffce02550a85c7c3316a05ea598 ]

Enable module name to be printed in pr_xxx and dev_xxx
Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded
string "ni_usb_gpib" in usb_driver struct.

Remove __func__ parameter from pr_err and dev_err.

Remove __func__ parameter from dev_dbg as this can be
enabled by dynamic debug.

Remove commented printk's and dev_err's.

Remove kmalloc failed messages.

Remove buffer over run bug dev_err message as this just checks
for a bug in the driver which does not exist.

Remove read/write length too long messages and return -EINVAL

Change dev_info to dev_dbg where possible.

Move attach message to the end of attach function.

Remove buffer overrun message. Use actual array indeces
instead of i and i++ to make code clear and check redundnant.

Remove module init and exit pr_info's.

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250214114708.28947-15-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 18ce5b5d9167bffce02550a85c7c3316a05ea598 ]

Enable module name to be printed in pr_xxx and dev_xxx
Use DRV_NAME defined as KBUILD_MODNAME instead of hard coded
string "ni_usb_gpib" in usb_driver struct.

Remove __func__ parameter from pr_err and dev_err.

Remove __func__ parameter from dev_dbg as this can be
enabled by dynamic debug.

Remove commented printk's and dev_err's.

Remove kmalloc failed messages.

Remove buffer over run bug dev_err message as this just checks
for a bug in the driver which does not exist.

Remove read/write length too long messages and return -EINVAL

Change dev_info to dev_dbg where possible.

Move attach message to the end of attach function.

Remove buffer overrun message. Use actual array indeces
instead of i and i++ to make code clear and check redundnant.

Remove module init and exit pr_info's.

Signed-off-by: Dave Penkler &lt;dpenkler@gmail.com&gt;
Link: https://lore.kernel.org/r/20250214114708.28947-15-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: ni_usb: Handle gpib_register_driver() errors</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Nihar Chaithanya</name>
<email>niharchaithanya@gmail.com</email>
</author>
<published>2024-12-30T18:56:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ecf8a9b2d86e56bb821dfcfb2b016fc1e7139abd'/>
<id>ecf8a9b2d86e56bb821dfcfb2b016fc1e7139abd</id>
<content type='text'>
[ Upstream commit 635ddb8ccdbde0d917b0a7448b0fd9d6cc27a2a9 ]

The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.

In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err() statements indicating the
fail and error value.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-14-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 635ddb8ccdbde0d917b0a7448b0fd9d6cc27a2a9 ]

The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.

In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err() statements indicating the
fail and error value.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-14-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: gpib: Modify gpib_register_driver() to return error if it fails</title>
<updated>2025-04-10T12:42:01+00:00</updated>
<author>
<name>Nihar Chaithanya</name>
<email>niharchaithanya@gmail.com</email>
</author>
<published>2024-12-30T18:56:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=59dbe788e1b9b95f66cf56b71e19baf8201a6ed1'/>
<id>59dbe788e1b9b95f66cf56b71e19baf8201a6ed1</id>
<content type='text'>
[ Upstream commit e999bd2a897e7d70fa1fca6b80873529532322fe ]

The function gpib_register_driver() can fail if kmalloc() fails,
but it doesn't return any error if that happens.

Modify the function to return error i.e int. Return the appropriate
error code if it fails. Remove the pr_info() statement.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-2-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit e999bd2a897e7d70fa1fca6b80873529532322fe ]

The function gpib_register_driver() can fail if kmalloc() fails,
but it doesn't return any error if that happens.

Modify the function to return error i.e int. Return the appropriate
error code if it fails. Remove the pr_info() statement.

Signed-off-by: Nihar Chaithanya &lt;niharchaithanya@gmail.com&gt;
Link: https://lore.kernel.org/r/20241230185633.175690-2-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Stable-dep-of: a239c6e91b66 ("staging: gpib: Fix Oops after disconnect in ni_usb")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
