Received: by 10.192.165.156 with SMTP id m28csp27128imm; Tue, 10 Apr 2018 15:40:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx498khVROiQC+nzg0OeRpRmU+HIOlClPRJtHhO9P0UjJwCfSJF1B9IiaBzV2raLDETnIrnDr X-Received: by 2002:a17:902:3225:: with SMTP id y34-v6mr2404338plb.180.1523400044609; Tue, 10 Apr 2018 15:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523400044; cv=none; d=google.com; s=arc-20160816; b=PCCthU+siPJB3xXWahbhBdXXhPTZqmH/+ovD+v0nIIQ8T73XiJmCJZxalVfSiLWU/J ueThFA9Cz7rD6Xyyw03jQ5OMuSJgtDf/a/tczSSk8QgsfLcnCYj6QL72Y0RPz15sVVIF kMtoWJB2JdHhYjSozox1QIfrtybELqqOfwfJSZFNoFl9UdHi/FCRVF4+6p2g8nP8Gu3v zmdCz8K921EGzZWxu1WNQkmT+LOHKZ001Flj7v6PBodDZEYblpRX0AKc11mMxB512ApK a6AHSfCfS2zGzTnsaXtSTj+wbUVIAIJwZujWnhK+zLRpt9lbdta1M3MnQ2d77uOqjcqw OTRw== 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=ZLipAjt/tfAbRvaMNojmDpbZBgP7LOhIfKOagy3idZQ=; b=Dm23ScHSTkVlnQ2AkBCKonfT3VT9dSEzQAi92jykuJIgtr8V052/O59fefnAIOF5Jt /O1DsBP/Jkp54faO1RHgSfUe/lqB5JgOK+DiGfY/m3u/7ZOXygcmrxoDMNxJTW2dKo8y G6nu3cDOHBZ00mRVYJSXM4SjNQ6ccHL3YKo9XSt/PdOLE6mA80TeZ+T1QqdvI6tVe3ks s07spSD74tOSTm5DcOFYKXwZa8EWhlv9UqyvfEwA+VHYszyzraaVwQ1rb6NfL0DEhA8f 8JsOXaIqcA9NXQyTU9R3HmVR4gMiNAtOoZvhmBDQoE+EOcPGjy/WLJyTLh7opLBTDYt5 feIA== 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 1-v6si3583967ple.629.2018.04.10.15.40.08; Tue, 10 Apr 2018 15:40:44 -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 S932398AbeDJWg3 (ORCPT + 99 others); Tue, 10 Apr 2018 18:36:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42762 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932385AbeDJWgZ (ORCPT ); Tue, 10 Apr 2018 18:36:25 -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 3F94BE1B; Tue, 10 Apr 2018 22:36:18 +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.14 061/138] scsi: libsas: fix error when getting phy events Date: Wed, 11 Apr 2018 00:24:11 +0200 Message-Id: <20180410212909.194826721@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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]);