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

    xhci: Fix conditional check in bandwidth calculation.

to the 3.4-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:
     xhci-fix-conditional-check-in-bandwidth-calculation.patch
and it can be found in the queue-3.4 subdirectory.

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


>From 392a07ae3316f2b90b39ce41e66d6f6b5c95de90 Mon Sep 17 00:00:00 2001
From: Sarah Sharp <[email protected]>
Date: Thu, 25 Oct 2012 13:44:12 -0700
Subject: xhci: Fix conditional check in bandwidth calculation.

From: Sarah Sharp <[email protected]>

commit 392a07ae3316f2b90b39ce41e66d6f6b5c95de90 upstream.

David reports that at drivers/usb/host/xhci.c:2257:

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
}

The static analyser cppcheck says

[linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If 
ep_type == 5, the comparison ep_type != 7 is always true.

Maybe the original programmer intention was something like

static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
    return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
}

Fix this.

This patch should be backported to stable kernels as old as 3.2, that
contain the commit 2b69899934c63b7b9432568584fb4c4a2924f40c "xhci: USB
3.0 BW checking."

Signed-off-by: Sarah Sharp <[email protected]>
Reported-by: David Binderman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/usb/host/xhci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2253,7 +2253,7 @@ static bool xhci_is_async_ep(unsigned in
 
 static bool xhci_is_sync_in_ep(unsigned int ep_type)
 {
-       return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
+       return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
 }
 
 static unsigned int xhci_get_ss_bw_consumed(struct xhci_bw_info *ep_bw)


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

queue-3.4/xhci-fix-null-pointer-dereference-when-destroying-half-built-segment-rings.patch
queue-3.4/xhci-fix-conditional-check-in-bandwidth-calculation.patch
queue-3.4/xhci-fix-td-size-calculation-on-1.0-hosts.patch
queue-3.4/usb-host-xhci-stricter-conditional-for-z1-system-models-for-compliance-mode-patch.patch
queue-3.4/xhci-add-lynx-point-lp-to-list-of-intel-switchable-hosts.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to