* [PATCH] scsi: qla2xxx: check for kstrtol() failure
@ 2019-02-20 5:39 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2019-02-20 5:39 UTC (permalink / raw)
To: kernel-janitors
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>
---
drivers/scsi/qla2xxx/qla_attr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 2eb1ae721a7d..f928c4d3a1ef 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -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) {
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: qla2xxx: check for kstrtol() failure
@ 2019-03-07 0:19 Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-03-07 0:19 UTC (permalink / raw)
To: kernel-janitors
Dan,
> 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'.
Applied to 5.1/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-07 0:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-20 5:39 [PATCH] scsi: qla2xxx: check for kstrtol() failure Dan Carpenter
-- strict thread matches above, loose matches on Subject: below --
2019-03-07 0:19 Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).