Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2346174imm; Thu, 7 Jun 2018 09:07:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxd5jUg6EDlVQeefOKEzjlQSBJl6BqzPgr2kCRL/8kWpluSQd7s8rB+faJFgM9xWuhHoHD X-Received: by 2002:a63:3759:: with SMTP id g25-v6mr2125237pgn.59.1528387651838; Thu, 07 Jun 2018 09:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528387651; cv=none; d=google.com; s=arc-20160816; b=QZYqcXkDv3JT2jH4OL8xnU6ukO21FlOn0gTAEg81YnsEsmCjG9LVMdRtaMPqlncu7U 3RX4t0s4AqgCYGZebIlitjd2gZYtqnGlPFqSW4FQPQTQBdwaQzBefPaRHOA4K5tVOFHp eqRWd/MhGie/AQy47CghZrg2LR84qqObjgO/L4o6fBPV7dNzIdj2e6SRfQTxop85PCSH K5WUiROruXoPN0jKleMEtbdXZq+kAp0Embxxwwofh3DC+7YwT5J8UG3whMLyrC69Uh1P rUx4Qe1WTrLmkYFKeWHdgPW/EW/F/AwjIsg5PD6WdOFnVDTmNKopwn593oGtaR1sJz3O woTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=BuLtXD4wF/2yr+YhApVK6xmQosIiGczu6yFoXX7Ke9k=; b=f1eSC3m9biER9mzwZ6EOD7MbAmqemM1JqKbMGbFjH9/HtZQAsMYnwIK1yyQH/k084V MrKuy9zQobpr0MF21eLsjA4DD/XL4uJBZc6WpzaCnKBFkQB/uA4DSBb1FcE6omSScwXQ qvAYB4k9DdciTI8ZFugp++1kh6nO7hzykhwM5BhsUoAkiX+tYt+NTC2KpZ5ppiWopE1X i8GwXvv2710/dgwanvROMMz4O6mBK7iZoyYwUzjPtklQ9jLv28eCStyAo+fZPJ/r5AQL bJootzG+n1sl7PlNBc8Q4IAnjsANwB5GxBET4d+ZM4oTKJm7vZ213VaGdANc4sg8Nvoi SAZQ== 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 s84-v6si16064557pfg.175.2018.06.07.09.07.17; Thu, 07 Jun 2018 09:07:31 -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 S935950AbeFGQFN (ORCPT + 99 others); Thu, 7 Jun 2018 12:05:13 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39243 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933010AbeFGOJE (ORCPT ); Thu, 7 Jun 2018 10:09:04 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvb4-0005Zx-II; Thu, 07 Jun 2018 15:09:02 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb1-0002pH-Bt; Thu, 07 Jun 2018 15:08:59 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Christoph Hellwig" , "chenqilin" , "Martin K. Petersen" , "Jason Yan" , "chenxiang" , "John Garry" , "Hannes Reinecke" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 100/410] scsi: libsas: fix error when getting phy events In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jason Yan commit 2b23d9509fd7174b362482cf5f3b5f9a2265bc33 upstream. 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: Ben Hutchings --- 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]);