lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 3 Jan 2019 17:23:02 +0000
From:   <Don.Brace@...rochip.com>
To:     <gustavo@...eddedor.com>, <mahesh.rajashekhara@...rosemi.com>,
        <don.brace@...rosemi.com>, <jejb@...ux.ibm.com>,
        <martin.petersen@...cle.com>
CC:     <esc.storagedev@...rosemi.com>, <linux-scsi@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: smartpqi_init: fix boolean expression in
 pqi_device_remove_start

-----Original Message-----
From: Gustavo A. R. Silva [mailto:gustavo@...eddedor.com] 
Sent: Thursday, January 3, 2019 10:48 AM
To: Mahesh Rajashekhara <mahesh.rajashekhara@...rosemi.com>; Don Brace <don.brace@...rosemi.com>; James E.J. Bottomley <jejb@...ux.ibm.com>; Martin K. Petersen <martin.petersen@...cle.com>
Cc: esc.storagedev@...rosemi.com; linux-scsi@...r.kernel.org; linux-kernel@...r.kernel.org; Gustavo A. R. Silva <gustavo@...eddedor.com>
Subject: [PATCH] scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start

EXTERNAL EMAIL


Fix boolean expression by using logical AND operator '&&'
instead of bitwise operator '&'.

This issue was detected with the help of Coccinelle.

Fixes: 1e46731efd9c ("scsi: smartpqi: check for null device pointers")
Signed-off-by: Gustavo A. R. Silva <gustavo@...eddedor.com>

Thanks for the update.
Acked-by: Don Brace <don.brace@...rosemi.com>

---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index e2fa3f476227..40f58238ce4a 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -323,7 +323,7 @@ static inline void pqi_device_remove_start(struct pqi_scsi_dev *device)  static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info,
                                        struct pqi_scsi_dev *device)  {
-       return device->in_remove & !ctrl_info->in_shutdown;
+       return device->in_remove && !ctrl_info->in_shutdown;
 }

 static inline void pqi_schedule_rescan_worker_with_delay(
--
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ