Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp249139rwb; Wed, 9 Nov 2022 01:46:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM6nHuUYUUIPjsZEjPZ9m55zm39rXpSoyE+pQNE3UbsTui29Wys6JclIwRh9svQe2GvITilk X-Received: by 2002:a17:906:ef8b:b0:7ad:b724:e731 with SMTP id ze11-20020a170906ef8b00b007adb724e731mr54327027ejb.33.1667987219359; Wed, 09 Nov 2022 01:46:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667987219; cv=none; d=google.com; s=arc-20160816; b=qIzMgtQZPDCTgxR6LKU+b5oGNgtayfignSftyvnrtsMoC/DvxhLAqtZSakvYO0Ko6f /bV2x6e6ZFAl5SY406Jv2jDKjmqgY1bIeTJzYU1J+dfFWgTLX8FJBDNcqVbPJ/i08In4 KBoILbz57W73fmKpVV0hMxWNwErXVlmrxJ5FjoSIrJr5EiI/oo5gZeKqXmy+/wCmL8TB pTBpHN55KhVv3Pj6aGcvsFkst0BXbu0KGDnI82ERk760WtA9+ONlEY4Yakets9NZIk2N 5ERwZjRC33G5OfZyZ1tU8DgGhObpilDbb7dd2PylZNvys3ytRFx9MKr29NhVAbcm7prN 1RSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from; bh=YNj25b+vxt2+Xta81z4o/RMlp8hiA9LU+Th/5lQbZP4=; b=EYGJbNzH6osSs+VkWYszFrYq8R+BdFrXl5b86s0qMBSWtA+uJUvA3z9r+GuLK2O3qX m5knS1ZqsrCQbX5znd5qxww521UeDsHPqyATRRPs6hUh4QAIc2G2bEFBdlVjhOY6jAFQ rfYEeQM3umVo0ElyZAp2uJYGXevDzNnkTA1BRsz9JLeAgJbztppDzZJBeGPpeX9zwrUw G8OThR9JoQFSRYiU6Z3n5TDn+gN/VPKXVVMDTKxe8M5J9gu8iHsMYQIPDSEIU0TnJgYW uVwKYeopQ8dhQZh1RxpQRtQMnj0zEVlBmqthQQGM6xgKX4Zo/andgf8asLgdIfQzTpWB P5tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a508e18000000b00462750bbe08si13499904edw.522.2022.11.09.01.46.22; Wed, 09 Nov 2022 01:46:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbiKIJi7 (ORCPT + 99 others); Wed, 9 Nov 2022 04:38:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230407AbiKIJiw (ORCPT ); Wed, 9 Nov 2022 04:38:52 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BF01F5B7; Wed, 9 Nov 2022 01:38:44 -0800 (PST) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4N6fwD709dzJnQM; Wed, 9 Nov 2022 17:35:40 +0800 (CST) Received: from dggpemm500015.china.huawei.com (7.185.36.181) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 17:38:42 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500015.china.huawei.com (7.185.36.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 9 Nov 2022 17:38:41 +0800 From: Wang ShaoBo CC: , , , , , Subject: [PATCH] Bluetooth: 6LoWPAN: add missing hci_dev_put() in get_l2cap_conn() Date: Wed, 9 Nov 2022 17:37:26 +0800 Message-ID: <20221109093726.3132203-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500015.china.huawei.com (7.185.36.181) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org hci_get_route() takes reference, we should use hci_dev_put() to release it when not need anymore. Fixes: 6b8d4a6a0314 ("Bluetooth: 6LoWPAN: Use connected oriented channel instead of fixed one") Signed-off-by: Wang ShaoBo --- net/bluetooth/6lowpan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 215af9b3b589..c57d643afb10 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -972,6 +972,7 @@ static int get_l2cap_conn(char *buf, bdaddr_t *addr, u8 *addr_type, hci_dev_lock(hdev); hcon = hci_conn_hash_lookup_le(hdev, addr, *addr_type); hci_dev_unlock(hdev); + hci_dev_put(hdev); if (!hcon) return -ENOENT; -- 2.25.1