Skip to content

Commit

Permalink
scsi: qla2xxx: Correct the check for sscanf() return value
Browse files Browse the repository at this point in the history
Since the version string has been modified, sscanf() returns 4 instead of
6.

Link: https://lore.kernel.org/r/20200929102152.32278-2-njavali@marvell.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Saurav Kashyap authored and Martin K. Petersen committed Sep 30, 2020
1 parent 2dd39fa commit 7dc0f67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/scsi/qla2xxx/qla_tmpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ qla27xx_driver_info(struct qla27xx_fwdt_template *tmp)
uint8_t v[] = { 0, 0, 0, 0, 0, 0 };

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);
"%hhu.%hhu.%hhu.%hhu",
v + 0, v + 1, v + 2, v + 3) != 4);

tmp->driver_info[0] = cpu_to_le32(
v[3] << 24 | v[2] << 16 | v[1] << 8 | v[0]);
Expand Down

0 comments on commit 7dc0f67

Please sign in to comment.