Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146837pxv; Fri, 9 Jul 2021 19:30:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMQpg+LnZ7KsMpvULj2L74DnwJdFrjdMiudRWW81YR+TRjK2c6PItGLZMZvRfZ2R90X7yM X-Received: by 2002:a17:906:179b:: with SMTP id t27mr39907973eje.70.1625884217859; Fri, 09 Jul 2021 19:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884217; cv=none; d=google.com; s=arc-20160816; b=EUuD2iMLIOz56zUDF4fvLs2gIdZ/yw92zNs5YHPDMSEhDtOpe8RZPxcVNXLUSwqcpg LDK4ZQm+NA+rINie8IIvhxvtKxwG2zGQK+Npvv5p7C5nRNsbxHbKp/tJ1q3iA+gQ5zjC Dx4OQf9ModXc+W0CeNap3jcmNlmMwlnfhOilrKGS4ZB0/XJmFECvJk8m3WLyP0rxYW5q hhtGrE7oUl8S/7+jAq6VQD27Fj0E5/m6jJQDruQatrz6YWSpU1xn1m1FGLvjb+SWBicR rE8yn0sUUyPxjI1MgIwzFRzKQjVN8AdlYt9unMTQrf0qBIwoIHIK9yHuBGqxfxUtE4gg 4Epw== 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=NzKEhzfpEo0PaR4CLDiEEWu6ALdISm4PfsMY9ZBkY2aAmIJ8uWTXesijVCeujj5k72 xcVdiW/KlrSHsIdsjSNi7V/7DS/CVQwzkaDh54yzL80rGqWpi0XPQo78RFc4CE1o+Zd2 OfHfS0NIAX87hqEhrE2nxH3xoK/8K6M11dfXWsmh9q/zYD0f+X7UGEoyh4YkRSmbXaii uUwydP/enf+5a67JhEmTsTHBGFKzGobwt48DN1zMj3pq58ly1pPPpvtpx9zC7RLDU1N7 R9an6QL7S7cbG+FsKP33ffEa/tS7JeJF14pU/RqV1X7k6J0arn6rvqtDZxZHVt6FOFkW G29A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cvluvZ+K; 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 w3si9184003ejf.235.2021.07.09.19.29.55; Fri, 09 Jul 2021 19:30:17 -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=cvluvZ+K; 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 S234206AbhGJCbo (ORCPT + 99 others); Fri, 9 Jul 2021 22:31:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:42924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233095AbhGJC3D (ORCPT ); Fri, 9 Jul 2021 22:29:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 56793613CC; Sat, 10 Jul 2021 02:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883922; bh=5uGHoFbxC057inXKnuUYBivDyaNYMVwoUbIjXcXUV6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cvluvZ+KIjuhXRP5PU/0PiEG8SocuCKWFn18NMDVMcsDGxwcChDkKvCk1HAgGjqBt Jqw6M5y9HhAFcebiKzIdh8FhIiWrN+NCtEv6fhiZxqjz8RBnjjwycGsOdGh3KJZsWN Kqtm5rJuRzddeVoNEAj15fM0hk/vdPEksw7Ij8QOHCiT44VXgyjjiOARXAn6kqxZyr WxIb9k9IQAW39ichkgURYGWz4p1Q/W/Hyj/PafsvpVhwS+y/FFzKgPIW1/AbFuTZxF 3FWTDBdQggLdoKpMRcrTF4VqcF3uuZ1kAmWoqpf4VJan7lfjuQ6lsGczojZUJovfSD QQMGh103hHZ7g== 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.10 40/93] scsi: qedi: Fix null ref during abort handling Date: Fri, 9 Jul 2021 22:23:34 -0400 Message-Id: <20210710022428.3169839-40-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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