net: caif: fix double disconnect client in chnl_net_open()
authorZhengchao Shao <shaozhengchao@huawei.com>
Fri, 11 Nov 2022 01:47:34 +0000 (09:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:35:39 +0000 (17:35 +0100)
[ Upstream commit 8fbb53c8bfd8c56ecf1f78dc821778b58f505503 ]

When connecting to client timeout, disconnect client for twice in
chnl_net_open(). Remove one. Compile tested only.

Fixes: 2aa40aef9deb ("caif: Use link layer MTU instead of fixed MTU")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/caif/chnl_net.c

index 12063f3338972732d15a7bee025732b4f9cad44b..1bfcfcb68a26bcfcec2e2013a0f3e7d060df3855 100644 (file)
@@ -316,9 +316,6 @@ static int chnl_net_open(struct net_device *dev)
 
        if (result == 0) {
                pr_debug("connect timeout\n");
-               caif_disconnect_client(dev_net(dev), &priv->chnl);
-               priv->state = CAIF_DISCONNECTED;
-               pr_debug("state disconnected\n");
                result = -ETIMEDOUT;
                goto error;
        }