mei: fix incorrect logical operator in if statement
authorColin Ian King <colin.king@canonical.com>
Tue, 19 Dec 2017 17:35:30 +0000 (17:35 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 16:09:29 +0000 (17:09 +0100)
The current expression using the || operator is always true because
dev->dev_state cannot be equal to two different values at the same time.
Fix this by replacing the || with &&.

Detected by CoverityScan, CID#1463042 ("Constant expression result")

Fixes: 8d52af6795c0 ("mei: speed up the power down flow")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/hw-me.c

index 0b21f9e..334ab02 100644 (file)
@@ -1261,7 +1261,7 @@ irqreturn_t mei_me_irq_thread_handler(int irq, void *dev_id)
                        break;
 
                if (rets &&
-                   (dev->dev_state != MEI_DEV_RESETTING ||
+                   (dev->dev_state != MEI_DEV_RESETTING &&
                     dev->dev_state != MEI_DEV_POWER_DOWN)) {
                        dev_err(dev->dev, "mei_irq_read_handler ret = %d.\n",
                                                rets);