提交 e2934ed1 编写于 作者: J James Smart 提交者: Martin K. Petersen

scsi: lpfc: Fix lpfc_wwn_set return code check

When I reversed the patch to re-add the lpfc_soft_wwn parameter feature,
it re-added code that had a long-standing bug. (that's what I get I
guess :)

As Dan Carpenter pointed out - error checks looked at wrong polarity.  0
is success, -errno is failure. Updated checks.
Signed-off-by: NJames Smart <james.smart@broadcom.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 f2a3313d
...@@ -2150,7 +2150,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr, ...@@ -2150,7 +2150,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr,
phba->soft_wwn_enable = 0; phba->soft_wwn_enable = 0;
rc = lpfc_wwn_set(buf, cnt, wwpn); rc = lpfc_wwn_set(buf, cnt, wwpn);
if (!rc) { if (rc) {
/* not able to set wwpn, unlock it */ /* not able to set wwpn, unlock it */
phba->soft_wwn_enable = 1; phba->soft_wwn_enable = 1;
return rc; return rc;
...@@ -2231,7 +2231,7 @@ lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr, ...@@ -2231,7 +2231,7 @@ lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr,
return -EINVAL; return -EINVAL;
rc = lpfc_wwn_set(buf, cnt, wwnn); rc = lpfc_wwn_set(buf, cnt, wwnn);
if (!rc) { if (rc) {
/* Allow wwnn to be set many times, as long as the enable /* Allow wwnn to be set many times, as long as the enable
* is set. However, once the wwpn is set, everything locks. * is set. However, once the wwpn is set, everything locks.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册