From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B353CC636CC for ; Fri, 3 Feb 2023 10:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjBCKUC (ORCPT ); Fri, 3 Feb 2023 05:20:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjBCKT4 (ORCPT ); Fri, 3 Feb 2023 05:19:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F79903BC for ; Fri, 3 Feb 2023 02:19:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E670EB82A65 for ; Fri, 3 Feb 2023 10:19:21 +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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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