Received: by 10.213.65.68 with SMTP id h4csp1858264imn; Mon, 19 Mar 2018 15:26:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELslEDWBYHhRMbJwQf9l3tO+LRE7HgT5JazTcc4TFS8j1kuxJ0JsWVS9kjR3COYE53tkH3zv X-Received: by 2002:a17:902:d03:: with SMTP id 3-v6mr14175782plu.245.1521498386256; Mon, 19 Mar 2018 15:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521498386; cv=none; d=google.com; s=arc-20160816; b=M54+XuHNVLFQl78udjYyef4/NYTGV75mH4hEC54uumTurV+863ug+8PcmOD5S5wvNJ 26fgkl8gb7aXUw3LRaZb6MSne2E1CTm/Vu4GGtz3g+Kpc+HEr8s9oR3Fhw3wow9vuuvm yLBcKMUzUA9lrz+7QXQnvDgOvhPCB+CGcROAHO7B+VTXakloltLXgMTndpCHrDIAlnN8 xG2RT0IU1f5Nr39WHUJdacUOoNogzjIZz+7qgK3uowOlz7GhKFNih9qEEXiO5Uymv14T 5vRhyPy0ZPJOQ9WVPyfmtkK+jNugNAsg76BphsTtNdAmFo8Pa8/UYJXnu1QAF69vLkat 0QCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YekHIWNqU8bcYaicKq/l/ENwoBmZJL48d6uLBIBz/9A=; b=Shl/dgsB5pwQ6MamisuiBgekQEpVvRFaHlLMARmxadGKtsTq6OrVZXrSnGIMJI9Lt2 WfY0tlD8+c/lpGrHMMlPX4bZu73DKzlWTKc+gRspwf+mlZn/ivr1ivAR0xj+bS0d98UG ZAV0tdVf3DpacBB0JGF/wOl/QkD7P3iYNraX57s6hvpni6RyBzKraMHnB8zdkW2QqxaF 3c3/2LjloX6aiJ+Dr6/FQNROWkpZkKpkVVcgp0gSGYqjIksR8NHgYmUmonnq7PI6vU9m 3l7WGZAVAPBeVS11XZpBIpaMxiOl+QuGIzGc81pC2L+9acGONdsbqTzqcWifvWyL9bi6 gZeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=k4DRpM4E; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59-v6si206352plp.436.2018.03.19.15.26.12; Mon, 19 Mar 2018 15:26:26 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=k4DRpM4E; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936522AbeCSWYt (ORCPT + 99 others); Mon, 19 Mar 2018 18:24:49 -0400 Received: from mail-sn1nam01on0122.outbound.protection.outlook.com ([104.47.32.122]:60759 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933780AbeCSPtH (ORCPT ); Mon, 19 Mar 2018 11:49:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YekHIWNqU8bcYaicKq/l/ENwoBmZJL48d6uLBIBz/9A=; b=k4DRpM4E1yHNIBnEmDmx+7SJzxG6FF/ErMxRAyC/QlVmZK6APGU0UBbvn0OW4Ow0GP/Kj/P4IGLKFzpaYZxc+VlMarceQazJVzfOQTCNRAObY/JS8KF98o8swlA4ncHkloXqUJTdiLmx5ZvkSO59hWrZINvZV11kDJf88cbTADk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0981.namprd21.prod.outlook.com (52.132.133.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:05 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:05 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jason Yan , John Garry , chenqilin , chenxiang , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 088/124] scsi: libsas: fix error when getting phy events Thread-Topic: [PATCH AUTOSEL for 4.15 088/124] scsi: libsas: fix error when getting phy events Thread-Index: AQHTv5m+3SbmXLaQqUijAJl2KfdG8w== Date: Mon, 19 Mar 2018 15:48:37 +0000 Message-ID: <20180319154645.11350-88-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0981;7:MiQsYEJ6dxEujBb+7JARzJ2lc0kx6Cjgnl9in2g6dFHWSOmgJ0WHXF7i9lFtRL7StydNyzPY+WxmgPZSPrrOSsP18ijGSf0RXsnTZnrEW926lJTilJLBB3FM61eTbEwYlyfUy/98oAl3ddLU/4NpGlWHJcRsZ76QBqlXJa8trTylGC6ofxUR3b2rQVOQmpmKk4vs2EXBxcQA0TJ/20WL0ZaD0dIbL9TcyqfctYbb1hEA3eDYO07jnutpKJK4+zrn;20:uPiHB6oygSpyg3+8MpKHWhZiJsQY9qKdmWXjxYTJVI070WUpbQ8G16OPwAlfn91zbrX+VJJtlJaGJzBKnaTwDwGjCOXVHI03dK6sUDoEx0sC2v6H0rmvqjTAucp0ZOyW47WMhIlsjDS6YVIPShEEROS1GO7k3jagiUAa/cUSdig= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5c761ff6-29bc-4cb1-7ca6-08d58db0f1b8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0981; x-ms-traffictypediagnostic: DM5PR2101MB0981: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(50582790962513)(146099531331640); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0981;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0981; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(396003)(376002)(366004)(39860400002)(39380400002)(189003)(199004)(66066001)(6486002)(26005)(110136005)(5660300001)(54906003)(3280700002)(6512007)(68736007)(102836004)(6436002)(107886003)(10290500003)(53936002)(186003)(59450400001)(72206003)(14454004)(36756003)(6666003)(2950100002)(316002)(6506007)(22452003)(478600001)(10090500001)(106356001)(105586002)(99286004)(7736002)(3660700001)(86362001)(575784001)(76176011)(305945005)(86612001)(2501003)(97736004)(5250100002)(4326008)(3846002)(6116002)(1076002)(8936002)(25786009)(81156014)(81166006)(8676002)(2900100001)(2906002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0981;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: OeWqr43Mv/Lt3oxlqOPzeDRrCpqExioFJbuxe68sirFmPhfhMwVuoUiEZ/KztgZT8jbeuJbKvynvepRl5hURJYp2cCr8k0quLJyHQ9mSZm2B722en4S9vcpu2ND9NsLd02H+ohVdLOwKKKhqfs8WE7aIBGwArMSVvnr664TwIx23aDS0fjaobs4/b8Oi2Ap2HRLJHum41/kNnhQb9BD1qyZ3VKAyHMLn0Ja1hYLqfMeFcMbpNNAJirkh7p5lSq4TJ1Tdjr+FMDM4UnIrYulJVVQ/p9mw93yI54yiBQTCkKra5V4W9U+QOChW9eaihY5YHIHDhAsDwotSEw5Xx+syzQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c761ff6-29bc-4cb1-7ca6-08d58db0f1b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:48:37.6680 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0981 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/libsas/sas_expander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_e= xpander.c index 4b0c67ff35c5..6eab487e995e 100644 --- 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_phy *phy) res =3D smp_execute_task(dev, req, RPEL_REQ_SIZE, resp, RPEL_RESP_SIZE); =20 - if (!res) + if (res) goto out; =20 phy->invalid_dword_count =3D scsi_to_u32(&resp[12]); --=20 2.14.1