summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
authorJoe Carnuccio <joe.carnuccio@qlogic.com>2013-10-30 08:38:19 +0100
committerJames Bottomley <JBottomley@Parallels.com>2013-12-19 16:38:59 +0100
commitad5fa025d8fdc850f4ebf34d523a99739aae3e33 (patch)
tree69fb0f5cbcba052bf6308eab71a8333de19b298e /drivers/scsi/qla2xxx
parent[SCSI] qla2xxx: Add BSG interface for read/write serdes register. (diff)
downloadlinux-ad5fa025d8fdc850f4ebf34d523a99739aae3e33.tar.xz
linux-ad5fa025d8fdc850f4ebf34d523a99739aae3e33.zip
[SCSI] qla2xxx: Fix undefined behavior in call to snprintf().
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 3464782ab5a4..2a14df86f639 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -917,8 +917,8 @@ qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr,
return snprintf(buf, PAGE_SIZE, "%s\n",
vha->hw->mr.serial_num);
} else if (IS_FWI2_CAPABLE(ha)) {
- qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE);
- return snprintf(buf, PAGE_SIZE, "%s\n", buf);
+ qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE - 1);
+ return strlen(strcat(buf, "\n"));
}
sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;