Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145236pxv; Fri, 9 Jul 2021 19:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM/l6mv/QTolEK2Jeo3NAVc8z10llBJjd0+M5U7Xko7W1EWF+ZWVPR4dzbbPOZbx+K+egH X-Received: by 2002:a17:907:3c16:: with SMTP id gh22mr2295402ejc.158.1625884022987; Fri, 09 Jul 2021 19:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884022; cv=none; d=google.com; s=arc-20160816; b=HRncF7GrtOO7NFlU3gfhVyLxRsLsBWn3TdHP811OLeWEell3br78vBqsnEB0/4jhq4 6D6QJbBDIO8qk6QDjtF5SokdZLKzrbr1p0TR0QNZOpd+w8ubXUuxHKE3QvvaazgLWxi0 FSOx57TUx5BqqyPOPBHe1mOQIxfbswVihjsFJDoHwmyt+BdNDJ9w6qS6YbK1V4MWR49h C3D7yYEPI/GQH0+up2PYuyxd49F9jf4iA66vAXVa2f18T5jFfIpT+DxUaWO/DG4zmpBn /Z8hEPCFs63Mjl5zfLbNnnty1kFR/m9a3VPULCO1LfAmv6HrtL4+TqiOuOFCt6Uzg0j0 LXEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0gpsn4MDqHDrIbQ475hnEVDdUwaF6tFfoWYm8qkDgsI=; b=HMv1QnWzjXzI0rIWOUazLVuSdDr6QoRDZ3m8U5vB8VwovzvWnCLNTDK+VbTPU7zoRw m6FftB2mblHd/7dF3I6PGir0fcDicAVVO4fZyJp/cAEZW8PO1++1coT+NxAD+GFttQj+ BwL/DI4g/9lASU0/ePuPhd53LLXQvcsKGjtXxNbX6RhBizbgUl2IEa/bMkDFuLNSTuAV 1i77vpj+ygxPVPpNz2/UQvmt7S5SgMv10oRMgbzGK1/wcaXc/+eQIyeEa+GbUDpq6Le7 H9hbf5XA4ulBEse4hz/FgHIASl8WtivKZTDWNKP3c8Nz7W7eHlxyUIomlDf69vFDxw6j 4Bqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkBLE7WL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jy12si9080156ejc.519.2021.07.09.19.26.40; Fri, 09 Jul 2021 19:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkBLE7WL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbhGJC0e (ORCPT + 99 others); Fri, 9 Jul 2021 22:26:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:42882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233125AbhGJCZi (ORCPT ); Fri, 9 Jul 2021 22:25:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0039661416; Sat, 10 Jul 2021 02:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883773; bh=5uGHoFbxC057inXKnuUYBivDyaNYMVwoUbIjXcXUV6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tkBLE7WLJs+vbilk2T+xFlg24mVxG0MD4pF9bU3374SwYbtyIwH26uCcJTTEcwxWG 5kcM96F5IlkFrL5TZcOhUdu2oe5eYqWYC/5kXcEE7wZapfFoqs8pJmvZSjmESklbVm YZbld5Trm9lqXXKg385L9ZFPnBilLhy0czcTaiF3VUToEhZPf96JdBmHQTqevp2jzC bLKRlNvn0PlXwQFnBsT8/q08Uh5nm0dRfQxxkWGof/3EMKqua+3J6OyGAzQrR/H6Sn OAagx8NTueNEXAyOI4sl95r0UP6Q0H4uI0rrErOEQ4gl3VLk6AcPOq1Yj9zCq1PVta Dc4VE/RAB4cFQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mike Christie , Manish Rangankar , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.12 043/104] scsi: qedi: Fix null ref during abort handling Date: Fri, 9 Jul 2021 22:20:55 -0400 Message-Id: <20210710022156.3168825-43-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Christie [ Upstream commit 5777b7f0f03ce49372203b6521631f62f2810c8f ] If qedi_process_cmd_cleanup_resp finds the cmd it frees the work and sets list_tmf_work to NULL, so qedi_tmf_work should check if list_tmf_work is non-NULL when it wants to force cleanup. Link: https://lore.kernel.org/r/20210525181821.7617-20-michael.christie@oracle.com Reviewed-by: Manish Rangankar Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qedi/qedi_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c index 440ddd2309f1..cf57b4e49700 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -1453,7 +1453,7 @@ static void qedi_tmf_work(struct work_struct *work) ldel_exit: spin_lock_bh(&qedi_conn->tmf_work_lock); - if (!qedi_cmd->list_tmf_work) { + if (qedi_cmd->list_tmf_work) { list_del_init(&list_work->list); qedi_cmd->list_tmf_work = NULL; kfree(list_work); -- 2.30.2