Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1150664pxv; Fri, 9 Jul 2021 19:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcVXo5JxzTreazgp91301qWi1eniEUBDqCZ8ZT4MW/LfDQnJ43htg6XX/I8WlmxxKV9zmP X-Received: by 2002:a05:6402:487:: with SMTP id k7mr50246637edv.315.1625884699983; Fri, 09 Jul 2021 19:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884699; cv=none; d=google.com; s=arc-20160816; b=FxP3lh32jPkxGdrzO/Nf4I83ljg/zLvqPRCuGR3CfEyBF/eo09hr5dzuvCb12sSUWf 4+3qkhquegxz6hWmssHqKvNqXfA7kQG3Fkkgeq0J4O+wM/85zf/MTyqgI4S9LvkoLxtU XwNDJJPFF0nmPQPSuQkGpsE5M9IvJYh4jynfOrYrvITWNbWRc396rZlTMKbF6eT/yT9O /pmzG3HnV/gLrgV1ERaeylZ8bYThp+U0lOcm00ylN+P9wI2OiekzCi8rs2p2VL92AzmK zWXJLwcgMW6lEryNNIC/gjndQZ4zwdmoR/rT8qIjoByZOl6UNE8P9bhGELv2+sybFp9n Uutg== 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=umlbhcYQjCmuwl1QXGKcJ0Pkt3imDCJAvPqhbDkSSn0=; b=hInDKJDw7EZXU+HyK3Y7wPMNsEucJoebNQKFjgO6RlloOpJr4C+xLeNLjwBHA4ee8f DCxMOHp4HRIWXQ2SCI7NpN85LqWcZeb0TWDVtSvE6ZNBoYjn9S7G+QK0L8Hec09qdYME Kw1U9gFddwYs+f304oUp0VABhfS8r48DAjn9ANYdoJlhSxib1dCbC7kXbtQooMHC14e3 oufqXV+vIDevnRINArebPe1S6J8cQ/+ol50iGwhsmFrUL9s4TrAQIHGMlZ2TatbHX3t0 UW1w2h220e4Kh6GaVhWFY59jV4iGxOsN4d5tW8p1swuNL0nDoGJKEtl9tzd3qsEV7ehV s7rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qi8EJ71n; 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 j2si8731147ejo.509.2021.07.09.19.37.56; Fri, 09 Jul 2021 19:38:19 -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=qi8EJ71n; 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 S234777AbhGJCjP (ORCPT + 99 others); Fri, 9 Jul 2021 22:39:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:53518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233819AbhGJCfZ (ORCPT ); Fri, 9 Jul 2021 22:35:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 044AA61411; Sat, 10 Jul 2021 02:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884344; bh=bE/IdGLh2cA14qDebd7mCLahEZQLYxLcg+ksd9ACITg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qi8EJ71nAg6s8gBirqaQsOAkBYrXM57IBGVHaIhxfG+jxBiaaEtB7r1q6rOquwSwz vAMJM4g3EXqCXXlrqCWP393upfQ6QmqoXeFs8Z4AP6wx0SmoLURTRoXLBPRLgZLyFY 8uAmjWLwZ2EjvRi++4T6SQPc4d1Y8uiEhifNChzrhH6xTiYi1/QoqU8RibH3d4/7yq Q6ajbQf1QXnGBfrrSfnACIE2T0UC/BQ1rEwr6GkAZ2T9ci5TNWTANHTWffvpSLTH9L 2iRtb/1DiqFYTi6xylDC2vyHaR7suTwbl9BcpTqahFE0IsFKtJxYnPaQrvRzaI1Wp0 Tg0K+7VSff9OA== 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 4.19 16/39] scsi: qedi: Fix null ref during abort handling Date: Fri, 9 Jul 2021 22:31:41 -0400 Message-Id: <20210710023204.3171428-16-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-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 357a0acc5ed2..b60b48f3b984 100644 --- a/drivers/scsi/qedi/qedi_fw.c +++ b/drivers/scsi/qedi/qedi_fw.c @@ -1466,7 +1466,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