Received: by 10.192.165.156 with SMTP id m28csp1102009imm; Wed, 11 Apr 2018 12:26:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx49WI2Huba839bdUXr3Z+TvAsN2+zPKmrw7e6b54AyNIGJ1Ot1/kVCU2Be0NSsUCe4NgdkOc X-Received: by 10.167.130.22 with SMTP id k22mr5098262pfi.73.1523474808628; Wed, 11 Apr 2018 12:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474808; cv=none; d=google.com; s=arc-20160816; b=r0ltUgNqN8PCb/+afNCgZXDZ+T4Fso/PgpNeXTf8TeQK1RoJbP+161WWbrJTumzZPH 8CFptZEwVDGqmFruvR6xPtEf3E9KJ/JzVdHHI3dJrIMNuX5FAyDjv4iFflJ1B9J5W8+R o9sLDV5W5F72RC0ifdwigZ5Zw2BsBW6flCuFeO/eiQnW+98sp967bofK6fxp8n9s38DD BtoFs31vO5a3xfOseHzpE80gpAJUqulwJ5o5N42j3dJ7Cc+yMq7AOblk8x/k4MUTJFy3 q2zbLGT+L6uZdIQX6HJB+lBL0UN4c5xP00g4r5+beRMrannKd+TYmKhu/oQ4wjF5+hOd iRxw== 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=FhxztfZv+cPGqv5eETrgYBOfH5qRrhiSCldP94yPzYo=; b=krUlLMb0CexY1mKWN5e/Ec6sxOYleeuSHBAxJqlw7z18JKuaIeaupFgMgV4e9hWjdI 2LBvBzGWqReFcH8aDU3FXTXmolTW/ke+fdHfmDZGb69uiZDg7GS+O86h1/tVPa+INMI5 rw4pvRJfZK2+6g/NmZUQJt9zUb39rbt+qMrNqxTfoQnHClrjcGDKL0wJy+RrqU5YRR0e 7SEIQ5iw72tKxAOAZPdfNUbuwwLiiL8zy9VuRbUAz1ITB3Mv/vOapgf4pxMDqp+IafLw RLywDgu3w2eKuwQB5VOjGdsF7gFyN6lDE4oLgnZOeKKIvLw5oS/CRdpYaNCDx+vXKQ/Y Vdvg== 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 n5si1336599pfi.360.2018.04.11.12.26.11; Wed, 11 Apr 2018 12:26:48 -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 S934862AbeDKTEd (ORCPT + 99 others); Wed, 11 Apr 2018 15:04:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39870 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933967AbeDKTEa (ORCPT ); Wed, 11 Apr 2018 15:04:30 -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 117A3BAC; Wed, 11 Apr 2018 19:04:29 +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.9 260/310] scsi: libsas: fix error when getting phy events Date: Wed, 11 Apr 2018 20:36:39 +0200 Message-Id: <20180411183633.848956297@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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]);