Skip to contentSkip to conversation

USB: Checking the wrong variable in usb_disable_lpm()

PATCH In review Dan Carpenter 2 participants 2 messages May 22, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: Checking the wrong variable in usb_disable_lpm()

We check "u1_params" instead of checking "u2_params".

---
Static checker stuff, not tested.

drivers/usb/core/hub.c +1 -1
index 04fb834..25a7422 100644
@@ -3379,7 +3379,7 @@ int usb_disable_lpm(struct usb_device *udev)
 		return 0;
 
 	udev->lpm_disable_count++;
-	if ((udev->u1_params.timeout = 0 && udev->u1_params.timeout = 0))
+	if ((udev->u1_params.timeout = 0 && udev->u2_params.timeout = 0))
 		return 0;
 
 	/* If LPM is enabled, attempt to disable it. */
#1 lore raw
Quoted 1 line · Dan Carpenter

We check "u1_params" instead of checking "u2_params".

Thanks for finding this, Dan. Your patch looks correct. I'll send it off to Greg (along with a fix for the signed-ness issue) soon.

I suspect the pull will be put off a week or so, since the merge window is coming, and Greg's traveling starting today.

Sarah Sharp

Quoted 18 lines

---
Static checker stuff, not tested.

drivers/usb/core/hub.c +1 -1
index 04fb834..25a7422 100644
@@ -3379,7 +3379,7 @@ int usb_disable_lpm(struct usb_device *udev)
 		return 0;
 
 	udev->lpm_disable_count++;
-	if ((udev->u1_params.timeout = 0 && udev->u1_params.timeout = 0))
+	if ((udev->u1_params.timeout = 0 && udev->u2_params.timeout = 0))
 		return 0;
 
 	/* If LPM is enabled, attempt to disable it. */