Skip to contentSkip to conversation

Patch "rt2x00usb: Fix error return code" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Oct 28, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

rt2x00usb: Fix error return code

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
rt2x00usb-fix-error-return-code.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 410280bac6224e066f4cf0b87db08f0418a135b6 Mon Sep 17 00:00:00 2001

From: Christophe Jaillet <[email protected]>
Date: Thu, 11 Aug 2016 16:38:54 +0200
Subject: rt2x00usb: Fix error return code

From: Christophe Jaillet <[email protected]>

commit 410280bac6224e066f4cf0b87db08f0418a135b6 upstream.

We know that 'retval = 0' because it has been tested a few lines above. So, if 'devm_kmalloc' fails, 0 will be returned instead of an error code. Return -ENOMEM instead.

Fixes 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
---
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +3 -1
@@ -831,8 +831,10 @@ int rt2x00usb_probe(struct usb_interface
 	rt2x00dev->anchor = devm_kmalloc(&usb_dev->dev,
 					sizeof(struct usb_anchor),
 					GFP_KERNEL);
-	if (!rt2x00dev->anchor)
+	if (!rt2x00dev->anchor) {
+		retval = -ENOMEM;
 		goto exit_free_reg;
+	}
 
 	init_usb_anchor(rt2x00dev->anchor);
 	return 0;

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/rt2x00usb-fix-error-return-code.patch