]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: Fix return value of board_mode store
authorJames Smart <james.smart@broadcom.com>
Wed, 12 Jul 2017 22:50:12 +0000 (18:50 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 14 Jul 2017 00:14:10 +0000 (17:14 -0700)
[backport of b18f2a8765fc072701452f710ac164d243ee4579]
From: rkennedy <dick.kennedy@avagotech.com>

Orabug: 26439257

On hbacmd reset failure, observing wrong string "nline" in kernel log.

On failure, non negative value (1) is returned from sysfs store
routine. It is interpreted as count by kernel and store routine is
called again with the remaining characters as input.

Fix: Return negative error code (-EIO) in case of failure.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/lpfc/lpfc_attr.c

index 651d39cdda0d1eb2d29f504e596d496eeb384535..482f29a53b67425a4e4909475d12de4b3f5f9e99 100644 (file)
@@ -1093,6 +1093,8 @@ lpfc_board_mode_store(struct device *dev, struct device_attribute *attr,
                        goto board_mode_out;
                }
                wait_for_completion(&online_compl);
+               if (status)
+                       status = -EIO;
        } else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0)
                status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
        else if (strncmp(buf, "warm", sizeof("warm") - 1) == 0)