projects
/
platform
/
kernel
/
linux-arm64.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
db64e93
)
[SCSI] qla2xxx: Fix undefined behavior in call to snprintf().
author
Joe Carnuccio
<joe.carnuccio@qlogic.com>
Wed, 30 Oct 2013 07:38:19 +0000
(
03:38
-0400)
committer
James Bottomley
<JBottomley@Parallels.com>
Thu, 19 Dec 2013 15:38:59 +0000
(07:38 -0800)
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>
drivers/scsi/qla2xxx/qla_attr.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/qla2xxx/qla_attr.c
b/drivers/scsi/qla2xxx/qla_attr.c
index
3464782
..
2a14df8
100644
(file)
--- 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 s
nprintf(buf, PAGE_SIZE, "%s\n", buf
);
+ qla2xxx_get_vpd_field(vha, "SN", buf, PAGE_SIZE
- 1
);
+ return s
trlen(strcat(buf, "\n")
);
}
sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;