From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C987E1FB4 for ; Fri, 3 Feb 2023 10:19:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C6D8C433D2; Fri, 3 Feb 2023 10:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1675419560; bh=B06MUh8XfIq82OyJwN9WqP9k1LOAHnNkBdbPXItvzmc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BbbzL2FWlOx0WtE/xShMAKNzyVo0g/HKFRGCZtSkpc73RAg4clDDID1lU3hSKAfb9 +y5rZWWp4tidbKWr5eXJ1VMoSJfE9phQ8qwgC3EbzzrPkQpSA5Atk2sZmaqbNmpJ0G slJ4ETlU4MfWVPwZ94ezxHraYcTmOiIrW1Mjrnvw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Paulo Alcantara (SUSE)" , Tom Talpey , David Howells , Long Li , Pavel Shilovsky , Ronnie Sahlberg , Steve French , Sasha Levin Subject: [PATCH 4.19 42/80] cifs: Fix oops due to uncleared server->smbd_conn in reconnect Date: Fri, 3 Feb 2023 11:12:36 +0100 Message-Id: <20230203101016.990393032@linuxfoundation.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203101015.263854890@linuxfoundation.org> References: <20230203101015.263854890@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: David Howells [ Upstream commit b7ab9161cf5ddc42a288edf9d1a61f3bdffe17c7 ] In smbd_destroy(), clear the server->smbd_conn pointer after freeing the smbd_connection struct that it points to so that reconnection doesn't get confused. Fixes: 8ef130f9ec27 ("CIFS: SMBD: Implement function to destroy a SMB Direct connection") Cc: stable@vger.kernel.org Reviewed-by: Paulo Alcantara (SUSE) Acked-by: Tom Talpey Signed-off-by: David Howells Cc: Long Li Cc: Pavel Shilovsky Cc: Ronnie Sahlberg Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smbdirect.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index c839ff9d4965..591cd5c70432 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1576,6 +1576,7 @@ void smbd_destroy(struct TCP_Server_Info *server) destroy_workqueue(info->workqueue); log_rdma_event(INFO, "rdma session destroyed\n"); kfree(info); + server->smbd_conn = NULL; } /* -- 2.39.0