OSDN Git Service
(root)
/
uclinux-h8
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58e060e
)
scsi: qla2xxx: Complain if parsing the version string fails
author
Bart Van Assche
<bvanassche@acm.org>
Fri, 9 Aug 2019 03:01:45 +0000
(20:01 -0700)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Tue, 13 Aug 2019 01:34:06 +0000
(21:34 -0400)
This patch fixes a Coverity complaint about not checking the sscanf()
return value.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_tmpl.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/qla2xxx/qla_tmpl.c
b/drivers/scsi/qla2xxx/qla_tmpl.c
index
de696a0
..
7ed481d
100644
(file)
--- a/
drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/
drivers/scsi/qla2xxx/qla_tmpl.c
@@
-860,8
+860,9
@@
qla27xx_driver_info(struct qla27xx_fwdt_template *tmp)
{
uint8_t v[] = { 0, 0, 0, 0, 0, 0 };
- sscanf(qla2x00_version_str, "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
- v+0, v+1, v+2, v+3, v+4, v+5);
+ WARN_ON_ONCE(sscanf(qla2x00_version_str,
+ "%hhu.%hhu.%hhu.%hhu.%hhu.%hhu",
+ v+0, v+1, v+2, v+3, v+4, v+5) != 6);
tmp->driver_info[0] = v[3] << 24 | v[2] << 16 | v[1] << 8 | v[0];
tmp->driver_info[1] = v[5] << 8 | v[4];