From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AIpwx49GWde5NlX8eYeEjyZ+GzwdPdksJjHw/hDqpl4qofubccISxzrLD3ZD9HUUiBscsBcpIzVr ARC-Seal: i=1; a=rsa-sha256; t=1523472212; cv=none; d=google.com; s=arc-20160816; b=p/sRG/cuTc/IsbPIfem8OgqgDxujYd7AwfypzPWYfq2oxHVHsygbY0Qa7B1+083rSW BqgA5RtT2Ui1unl/V4/l8i07hWd3d9LLg6/VgJrEckb2VQpoL2tUf/JUBqOZfJYda0qn zO4YWu9SfC+40auCsEmAS9KU3smaLNr8+knHL9sepsq3fwinwmiCDcsAAnk0/nv7OT7k v86OgV/BxQVsf4PmcQEa0SwDhO2/yjrb7cyK1zsrCV+pa788bZbh+oT3z1F9ZmssiJ0R 3DOzu7HG7px9EwcWWRQVfHiLeucM/UJyBfgqcpFPlFJxkYSUzNSIBbWqu1LvrpyGN4hu KoKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=96zhi2I86ZLdaDQ9jGPw6Se2iy1VobCE2m0EbcSFQIA=; b=0zox+a1fCH0qgEc/VNl2e2wV8n0/Yj4w27VuikbbLyKQSRuPenaCWdl6U525Y1d2r5 OZ5e1SpKccvtxuqIiPvKTPeIV+9nhdeQGFelnQu3SuVISN+I0KsDyg6Ux76EFrGetD62 QozFTsVQUve7/jngSd9c8KTqbdmcMSijqHjYkZhxPP5l3lOXLI7R90hYBtN8ql2j26Cu RWY9fGjKMuhsltXw2m3RzabcHQzxkzAG7M/oRgoy7SPjb9FVqdpc1SkL1ibBxTrGF+in X71fW9xfVDYxRPmMvPNw2lB606duZBvtrCMzV0TfliMr+fWfZFGNf1bBGiUln19OXuWO jGZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.61.202 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.61.202 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jason Yan , John Garry , chenqilin , chenxiang , Hannes Reinecke , Christoph Hellwig , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 3.18 093/121] scsi: libsas: fix error when getting phy events Date: Wed, 11 Apr 2018 20:36:36 +0200 Message-Id: <20180411183502.176663929@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183456.195010921@linuxfoundation.org> References: <20180411183456.195010921@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1597476398473498538?= X-GMAIL-MSGID: =?utf-8?q?1597476398473498538?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jason Yan [ Upstream commit 2b23d9509fd7174b362482cf5f3b5f9a2265bc33 ] The intend purpose here was to goto out if smp_execute_task() returned error. Obviously something got screwed up. We will never get these link error statistics below: ~:/sys/class/sas_phy/phy-1:0:12 # cat invalid_dword_count 0 ~:/sys/class/sas_phy/phy-1:0:12 # cat running_disparity_error_count 0 ~:/sys/class/sas_phy/phy-1:0:12 # cat loss_of_dword_sync_count 0 ~:/sys/class/sas_phy/phy-1:0:12 # cat phy_reset_problem_count 0 Obviously we should goto error handler if smp_execute_task() returns non-zero. Fixes: 2908d778ab3e ("[SCSI] aic94xx: new driver") Signed-off-by: Jason Yan CC: John Garry CC: chenqilin CC: chenxiang Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/libsas/sas_expander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -675,7 +675,7 @@ int sas_smp_get_phy_events(struct sas_ph res = smp_execute_task(dev, req, RPEL_REQ_SIZE, resp, RPEL_RESP_SIZE); - if (!res) + if (res) goto out; phy->invalid_dword_count = scsi_to_u32(&resp[12]);