Received: by 10.213.65.68 with SMTP id h4csp443851imn; Tue, 13 Mar 2018 09:13:20 -0700 (PDT) X-Google-Smtp-Source: AG47ELtVVTWrnIPzqLkBD9av48bnVFSUq7aX0bJ0XS4KwfwiqHNzPs9FNmF+ywXqSjQ8hKXCjvCy X-Received: by 10.98.103.136 with SMTP id t8mr1117847pfj.177.1520957600062; Tue, 13 Mar 2018 09:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520957600; cv=none; d=google.com; s=arc-20160816; b=MG1PQpTKpNk7KOXqwv4IhqQC69Aq0UnjG7d02qhxiPnBlWIos+CxuY+R3Zy4uFvKjM bdqOCh/5Ldtad3uLaetdNKdFej/EYST4eRgq20s4HVGtobf6y8QgdNMMNBM+Fyvtozn/ P//yvEpQH4ydDpC+azLaAEfPQHbGdA7suxdf/I+X6ah0WFeMBTvggwBFU9nIqXr67gBP L1bHa/4JidHXupjHokwaZ3FpcKOOtfjxw80rtE7U4cRw9a4ZPiz1hZ1MjZtJCQjQmeeF JRXUGDN6BYp5aaKeixbBdtgASkNvwaAyZMGZwJgXNQYlebaW2eFEhe2MTktZn08flAGz imVA== 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=Sq1sZ6hFugLrI5SfisLZtlf0OIZ42YAAVuGoXjloIiA=; b=fFLOzM8IGkW4Fh5+0Geh6Hj1QsrRUWU4c3C349PBiSHQWEZKtVGOIEOsvDAm+5M4CL oU32GgN2RJhSrGlcWeen8X7ftIrlUkGDM6tjyizRLqynu3MIS9ATsuFk2J+C5gANQYUG iSMXLjqMKAO7yp6UtoLbDfpQFLL7QG3Wanjl1pMyqQFHSGLgQsTAbVnF7p7iYV/VW8s2 yT46LVw4rTp6In93BZO31wpNRfXQmJjtMZfT99tQWL/PViwkIBwP2dWP5rSevSfFdXG9 X6BavKIee+uVqpyvX18jm2j1QcCsFpMCKx8elRRboW9PgnCdTIkfg3zKO9ke3SuiApQc kCrQ== 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 b3si257000pga.503.2018.03.13.09.13.05; Tue, 13 Mar 2018 09:13:20 -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 S934136AbeCMPgH (ORCPT + 99 others); Tue, 13 Mar 2018 11:36:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33398 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933694AbeCMPgF (ORCPT ); Tue, 13 Mar 2018 11:36:05 -0400 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4103E118E; Tue, 13 Mar 2018 15:36:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Quinn Tran , Himanshu Madhani , Hannes Reinecke , "Martin K. Petersen" Subject: [PATCH 4.14 025/140] scsi: qla2xxx: Fix gpnid error processing Date: Tue, 13 Mar 2018 16:23:48 +0100 Message-Id: <20180313152459.702051245@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180313152458.201155692@linuxfoundation.org> References: <20180313152458.201155692@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: Quinn Tran commit 22e786ea47f8795c561e1a01b6a66bb2cae2fc20 upstream. Stop GPNID command from advancing if command has failed. Fixes: 726b85487067d ("qla2xxx: Add framework for async fabric discovery") Cc: # 4.10+ Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qla2xxx/qla_gs.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3211,6 +3211,11 @@ static void qla2x00_async_gpnid_sp_done( sp->name, res, ct_req->req.port_id.port_id, ct_rsp->rsp.gpn_id.port_name); + if (res) { + sp->free(sp); + return; + } + memset(&ea, 0, sizeof(ea)); memcpy(ea.port_name, ct_rsp->rsp.gpn_id.port_name, WWN_SIZE); ea.sp = sp;