linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] csi: hpsa: Fix configured_logical_drive_count·check
@ 2017-10-16 19:28 Christos Gkekas
  2017-10-17  3:15 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Christos Gkekas @ 2017-10-16 19:28 UTC (permalink / raw)
  To: Don Brace, James E.J. Bottomley, Martin K. Petersen,
	esc.storagedev, linux-scsi, linux-kernel
  Cc: Christos Gkekas

Check whether configured_logical_drive_count is less than 255. Previous
check was always evaluating to true as this variable is defined as u8.

Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 9abe810..4ed3d26 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -4091,7 +4091,7 @@ static int hpsa_set_local_logical_count(struct ctlr_info *h,
 	memset(id_ctlr, 0, sizeof(*id_ctlr));
 	rc = hpsa_bmic_id_controller(h, id_ctlr, sizeof(*id_ctlr));
 	if (!rc)
-		if (id_ctlr->configured_logical_drive_count < 256)
+		if (id_ctlr->configured_logical_drive_count < 255)
 			*nlocals = id_ctlr->configured_logical_drive_count;
 		else
 			*nlocals = le16_to_cpu(
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] csi: hpsa: Fix configured_logical_drive_count·check
  2017-10-16 19:28 [PATCH] csi: hpsa: Fix configured_logical_drive_count·check Christos Gkekas
@ 2017-10-17  3:15 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-10-17  3:15 UTC (permalink / raw)
  To: Christos Gkekas
  Cc: Don Brace, James E.J. Bottomley, Martin K. Petersen,
	esc.storagedev, linux-scsi, linux-kernel


Christos,

> Check whether configured_logical_drive_count is less than
> 255. Previous check was always evaluating to true as this variable is
> defined as u8.

Applied to 4.14/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-17  3:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 19:28 [PATCH] csi: hpsa: Fix configured_logical_drive_count·check Christos Gkekas
2017-10-17  3:15 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).