Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-02-12 22:18:26 +0100
committerJiri Slaby <jslaby@suse.cz>2019-02-12 22:21:24 +0100
commit8a7b30aa8b51e21770932f901cd725bca3cbc4d9 (patch)
tree7e7d23b83b2b72f525cdbe607078408b933a3c22
parent1d622078b46955b4b9b39e0021b8926695c421ac (diff)
usb: gadget: udc: net2272: Fix bitwise and boolean operations
-rw-r--r--patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch48
-rw-r--r--series.conf1
2 files changed, 49 insertions, 0 deletions
diff --git a/patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch b/patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch
new file mode 100644
index 0000000000..16fbc8dba9
--- /dev/null
+++ b/patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch
@@ -0,0 +1,48 @@
+From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
+Date: Tue, 22 Jan 2019 15:28:08 -0600
+Subject: [PATCH] usb: gadget: udc: net2272: Fix bitwise and boolean operations
+References: bnc#1012628
+Patch-mainline: 4.20.8
+Git-commit: 07c69f1148da7de3978686d3af9263325d9d60bd
+
+commit 07c69f1148da7de3978686d3af9263325d9d60bd upstream.
+
+(!x & y) strikes again.
+
+Fix bitwise and boolean operations by enclosing the expression:
+
+ intcsr & (1 << NET2272_PCI_IRQ)
+
+in parentheses, before applying the boolean operator '!'.
+
+Notice that this code has been there since 2011. So, it would
+be helpful if someone can double-check this.
+
+This issue was detected with the help of Coccinelle.
+
+Fixes: ceb80363b2ec ("USB: net2272: driver for PLX NET2272 USB device controller")
+Cc: stable@vger.kernel.org
+Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
+Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/usb/gadget/udc/net2272.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/usb/gadget/udc/net2272.c b/drivers/usb/gadget/udc/net2272.c
+index 660878a19505..b77f3126580e 100644
+--- a/drivers/usb/gadget/udc/net2272.c
++++ b/drivers/usb/gadget/udc/net2272.c
+@@ -2083,7 +2083,7 @@ static irqreturn_t net2272_irq(int irq, void *_dev)
+ #if defined(PLX_PCI_RDK2)
+ /* see if PCI int for us by checking irqstat */
+ intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);
+- if (!intcsr & (1 << NET2272_PCI_IRQ)) {
++ if (!(intcsr & (1 << NET2272_PCI_IRQ))) {
+ spin_unlock(&dev->lock);
+ return IRQ_NONE;
+ }
+--
+2.20.1
+
diff --git a/series.conf b/series.conf
index c452dcbeca..7224ab5414 100644
--- a/series.conf
+++ b/series.conf
@@ -1060,6 +1060,7 @@
patches.kernel.org/4.20.8-321-arm64-dts-allwinner-a64-Fix-USB-OTG-regulator.patch
patches.kernel.org/4.20.8-322-usb-phy-am335x-fix-race-condition-in-_probe.patch
patches.kernel.org/4.20.8-323-usb-dwc3-gadget-Handle-0-xfer-length-for-OUT-E.patch
+ patches.kernel.org/4.20.8-324-usb-gadget-udc-net2272-Fix-bitwise-and-boolean.patch
########################################################
# Build fixes that apply to the vanilla kernel too.