Received: by 10.192.165.156 with SMTP id m28csp64796imm; Tue, 10 Apr 2018 16:30:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/0/05y/jHdmOkx9xaFS74rcQkOj4u4M2RZPp9Pm7Oi4+hqk29/QeYE+R9F6VopYVaFAl/R X-Received: by 2002:a17:902:24c7:: with SMTP id l7-v6mr2448044plg.320.1523403022231; Tue, 10 Apr 2018 16:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523403022; cv=none; d=google.com; s=arc-20160816; b=NMuGlv9kmaSwqN+nqUUGLQNETCIxW9k4rubtC1M9ielKaVjGeuQ8M7qBSk9Eh4PsmH ibhOn8Y4D7bcJ98wEFHIgel+L6PVJcPKP88UGbxp1fPq6FSTdfMvMQThD8KUe61dwAnV m5nX/C2iYzc/AmVPeyooUL5jpCOd8OnGKLwm+RPO4/Afz+gUW2sckbsjENtFDRNtZpil XTbfxnTDElQW9Uh8hczeGpHXG1aHPpXnL2L8RaUAP8AUyNWRIvPMHp4xWp3vUsocA2aT 1k6CMyb/dVJEGXanMilEJbx6H2roqY58QpJF76S2lql0r8d6up62XByLwu/0x7zWQO2x 1W3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tK64RKrBiNmUNUtAV9LJ8auzL3hJ/Q01IzsSOMFznhI=; b=LLHEAs+8D1IT/YC7gMipsTtZg8dQO0n/PfNXjOyyBWxDSnuXLoP3q2myZwAP6PcYwk 6kLh2sOC7/tJdXG4rkFlhzcpIM2LvmYgUy19cNdC1ievnP3x2s/OpJ+bh2b6u61sFQCi zXyzCK4muZig438Xt915f4mhwTrWATTHn0R78mbMxigKS03+iQitTwchX34cyLhkVBmY hJhq5TpHbe01bdq3mdangAmJtIEqPSFbMDdQgvx2qBwCReGqFtPCae8U/sm9Mfmov65n wvRYmS9YC4kYKsaIcRCW9HyjZ/ZyD1wbr5qTShirDzTP6bH9c7Np6/iHk/lfxdWYTpsP ZrXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i63si31397pge.219.2018.04.10.16.29.45; Tue, 10 Apr 2018 16:30:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbeDJXYq (ORCPT + 99 others); Tue, 10 Apr 2018 19:24:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39876 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754490AbeDJWaK (ORCPT ); Tue, 10 Apr 2018 18:30:10 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 83C51DA4; Tue, 10 Apr 2018 22:30:09 +0000 (UTC) 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 4.15 078/168] scsi: libsas: fix error when getting phy events Date: Wed, 11 Apr 2018 00:23:40 +0200 Message-Id: <20180410212803.604769837@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-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 @@ -686,7 +686,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]);