mirror of
https://github.com/torvalds/linux.git
synced 2024-12-20 10:01:56 +00:00
scsi: qla2xxx: check for kstrtol() failure
The error handling was unintentionally left out so it introduces a Smatch static checker warning: drivers/scsi/qla2xxx/qla_attr.c:1655 qla2x00_port_speed_store() error: uninitialized symbol 'type'. Fixes: a7b9ca7fc87a ("scsi: qla2xxx: Add support for setting port speed") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
f996861be1
commit
b8870ec636
@ -1652,6 +1652,8 @@ qla2x00_port_speed_store(struct device *dev, struct device_attribute *attr,
|
||||
}
|
||||
|
||||
rval = kstrtol(buf, 10, &type);
|
||||
if (rval)
|
||||
return rval;
|
||||
speed = type;
|
||||
if (type == 40 || type == 80 || type == 160 ||
|
||||
type == 320) {
|
||||
|
Loading…
Reference in New Issue
Block a user