Skip to content

Commit 695c002

Browse files
error27gregkh
authored andcommitted
scsi: pm8001: Fix error code in non_fatal_log_show()
[ Upstream commit 1b6f03b ] The non_fatal_log_show() function is supposed to return negative error codes on failure. But because the error codes are saved in a u32 and then cast to signed long, they end up being high positive values instead of negative. Remove the intermediary u32 variable to fix this bug. Fixes: dba2cc0 ("scsi: pm80xx: sysfs attribute for non fatal dump") Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Jack Wang <jinpu.wang@ionos.com> Link: https://patch.msgid.link/ahs-bEsBJH0KhnsX@stanley.mountain Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4902eec commit 695c002

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/scsi/pm8001/pm8001_ctl.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,10 +588,7 @@ static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL);
588588
static ssize_t non_fatal_log_show(struct device *cdev,
589589
struct device_attribute *attr, char *buf)
590590
{
591-
u32 count;
592-
593-
count = pm80xx_get_non_fatal_dump(cdev, attr, buf);
594-
return count;
591+
return pm80xx_get_non_fatal_dump(cdev, attr, buf);
595592
}
596593
static DEVICE_ATTR_RO(non_fatal_log);
597594

0 commit comments

Comments
 (0)