public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()
@ 2013-01-10  9:06 Dan Carpenter
  2013-01-11  8:33 ` Anil Gurumurthy
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-01-10  9:06 UTC (permalink / raw)
  To: Anil Gurumurthy
  Cc: Vijaya Mohan Guvva, James E.J. Bottomley, linux-scsi,
	linux-kernel, kernel-janitors

The closing parenthesis is in the wrong place so it takes the sizeof a
pointer instead of the sizeof the buffer minus one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index e6bf126..a5f7690 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1034,7 +1034,7 @@ bfad_start_ops(struct bfad_s *bfad) {
 			sizeof(driver_info.host_os_patch) - 1);
 
 	strncpy(driver_info.os_device_name, bfad->pci_name,
-		sizeof(driver_info.os_device_name - 1));
+		sizeof(driver_info.os_device_name) - 1);
 
 	/* FCS driver info init */
 	spin_lock_irqsave(&bfad->bfad_lock, flags);

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

* RE: [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()
  2013-01-10  9:06 [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops() Dan Carpenter
@ 2013-01-11  8:33 ` Anil Gurumurthy
  0 siblings, 0 replies; 2+ messages in thread
From: Anil Gurumurthy @ 2013-01-11  8:33 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Vijay Mohan Guvva, James E.J. Bottomley,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org



-----Original Message-----
From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-owner@vger.kernel.org] On Behalf Of Dan Carpenter
Sent: Thursday, January 10, 2013 2:36 PM
To: Anil Gurumurthy
Cc: Vijay Mohan Guvva; James E.J. Bottomley; linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; kernel-janitors@vger.kernel.org
Subject: [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops()

The closing parenthesis is in the wrong place so it takes the sizeof a pointer instead of the sizeof the buffer minus one.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c index e6bf126..a5f7690 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1034,7 +1034,7 @@ bfad_start_ops(struct bfad_s *bfad) {
 			sizeof(driver_info.host_os_patch) - 1);
 
 	strncpy(driver_info.os_device_name, bfad->pci_name,
-		sizeof(driver_info.os_device_name - 1));
+		sizeof(driver_info.os_device_name) - 1);
 
 	/* FCS driver info init */
 	spin_lock_irqsave(&bfad->bfad_lock, flags);
--


Looks good. Thanks for the patch, Dan.

Acked-by: Anil Gurumurthy<agurumur@brocade.com>


To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2013-01-11  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10  9:06 [patch] [SCSI] bfa: fix strncpy() limiter in bfad_start_ops() Dan Carpenter
2013-01-11  8:33 ` Anil Gurumurthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox