From patchwork Fri May 14 09:09:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 438825 Delivered-To: patch@linaro.org Received: by 2002:a02:b78d:0:0:0:0:0 with SMTP id f13csp158759jam; Fri, 14 May 2021 02:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx36kixYOCErQFhgzIZFjzt0i+Pw1g3+GGoGGnGZYrvw0bjbQy8KwsaMHCrhK4TfNhuGAGG X-Received: by 2002:a17:906:6a93:: with SMTP id p19mr48605793ejr.319.1620983439107; Fri, 14 May 2021 02:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620983439; cv=none; d=google.com; s=arc-20160816; b=KeFN7DzrYiXtNZfo8RuP6RMUPcDNZ1hEdsUHqNnIlmjnNemUxHik1gHvl0WKuyakfm pW5lG8UejJv/5+IgyLZ6yMdEAHoWQ/utak+4vqDj+NekTQ2vhiGOnOxDIg2DypAweO3H Uu7JkT6B0z8St2NsDHQYFAsHEHknJrkUQURBEYVHTG/i8c40orl7Wc9ifDEqGLGUggUr XSuveRse78MNjRZ/K4VLsbg15VOGZqEj8/XZ0X9sJ4tdrjnjZj5EOwetpZQQe7N0wd98 pvf9a2+5o7K8z63bjreA/83ER7hZeyRjAqWvLsOvjb3hbIul69VwCJg/4nWyDqPtdV1J YSzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FggzuMl78BIGoiOKUgnqPZLTqMHo3iz5Wm+voT/Uq+Y=; b=Ho+nPGCifm5Dvqw96En4cUDh0BBxyJ5qRGNhhfB8pAKYyBTAR9s5mY9w0VC3wj0YJO eCG8enc4l6LaIFyerokC/sE6vC+pGOCo8c8dQkaz13GLMbtLXYq62ytvqQme5kdeHMw2 Xaa3aRPvGubJb5Xw7gena+VSPkfbRAOpyjrgBt60zD3LDcgNy6Bbr1l4MSfWCVZ+n5Kg kd7wK++ulvnL4eeR3DCLZ8sni5RcyXLRXHESRsKMIid4sofl5W4LvmqftLAkvVjq6q5s xg0ObR8ehkjYCOyllXLMxChfYNmB8RdJNW8AHNYI6X0muXSBHVPHMwIvIKhkHJr8WV1Z xuDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si6897929ejj.281.2021.05.14.02.10.38 for ; Fri, 14 May 2021 02:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231716AbhENJLq (ORCPT ); Fri, 14 May 2021 05:11:46 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3759 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231726AbhENJLl (ORCPT ); Fri, 14 May 2021 05:11:41 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FhN2K0Pk9zqTXx; Fri, 14 May 2021 17:07:05 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 17:10:20 +0800 From: Zhen Lei To: Nilesh Javali , , "James E . J . Bottomley" , "Martin K . Petersen" , Giridhar Malavali , linux-scsi CC: Zhen Lei Subject: [PATCH 1/1] scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword() Date: Fri, 14 May 2021 17:09:52 +0800 Message-ID: <20210514090952.6715-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: a9083016a531 ("[SCSI] qla2xxx: Add ISP82XX support.") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- drivers/scsi/qla2xxx/qla_nx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.26.0.106.g9fadedd Reviewed-by: Himanshu Madhani diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 0677295957bc5cb..615e44af1ca6043 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c @@ -1063,7 +1063,8 @@ qla82xx_write_flash_dword(struct qla_hw_data *ha, uint32_t flashaddr, return ret; } - if (qla82xx_flash_set_write_enable(ha)) + ret = qla82xx_flash_set_write_enable(ha); + if (ret < 0) goto done_write; qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_WDATA, data);