[SCSI] bfa: fix strncpy() limiter in bfad_start_ops()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 10 Jan 2013 09:06:20 +0000 (12:06 +0300)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 30 Jan 2013 00:54:54 +0000 (11:54 +1100)
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>
Acked-by: Anil Gurumurthy <agurumur@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bfa/bfad.c

index e6bf12675db8d363f2f94a9483c2a3770e165ad9..a5f7690e819ef13e8c74b76dcf8be9bf3d42268d 100644 (file)
@@ -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);