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 X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06F55C433FE for ; Wed, 22 Sep 2021 14:16:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3C346115A for ; Wed, 22 Sep 2021 14:16:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236267AbhIVOSU convert rfc822-to-8bit (ORCPT ); Wed, 22 Sep 2021 10:18:20 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:37935 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236236AbhIVOSP (ORCPT ); Wed, 22 Sep 2021 10:18:15 -0400 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 81392CED34; Wed, 22 Sep 2021 16:16:44 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] Bluetooth: btmtkuart: fix a memleak in mtk_hci_wmt_sync From: Marcel Holtmann In-Reply-To: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> Date: Wed, 22 Sep 2021 16:16:44 +0200 Cc: Sean Wang , Johan Hedberg , Luiz Augusto von Dentz , Matthias Brugger , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <88B71D9F-DA0D-46A7-AC42-C9A5E5B95C7B@holtmann.org> References: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> To: Dinghao Liu X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dinghao, > bdev->evt_skb will get freed in the normal path and one error path > of mtk_hci_wmt_sync, while the other error paths do not free it, > which may cause a memleak. This bug is suggested by a static analysis > tool, please advise. > > Fixes: e0b67035a90b ("Bluetooth: mediatek: update the common setup between MT7622 and other devices") > Signed-off-by: Dinghao Liu > --- > drivers/bluetooth/btmtkuart.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel 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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 099C7C433F5 for ; Wed, 22 Sep 2021 14:20:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C664360F56 for ; Wed, 22 Sep 2021 14:20:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C664360F56 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=holtmann.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:References:Message-Id:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pePIwQWXl3PXMdn5jJ/DStGDIdea8gjVKEzMetZ2fYs=; b=sYG4I85GtdEOJ6 r9FXeU3HFvBWabuqKFSVdntjW+zBsxxKW29WD4ZG0O1MHlWsTEVN7jEvkEddLgUaivG1ln5tNwCay 8CLDPa/40RN8Ubtuwdndix5xlRmWxCxwD83h+GVZBO0S3J+uPsVUuCUHANRTjE9kEIpGvFKBrHmqr PobkUdID++W2p3dMyt7dF4oFJlhC9Mx1yove+z4hzEsq5Xekwj5qIkPJUffDmvYC4Q85MrSSO6jK6 HvmT3a4f1aOkzQJ0wZK/TFJK7ad778EjNgOmL8nexWZctT3TTlLORMdtEsBGGexIAiJTjEJyvMVQ1 r3S6J9hmgi82+slnL/+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT36F-008ngr-DO; Wed, 22 Sep 2021 14:19:51 +0000 Received: from coyote.holtmann.net ([212.227.132.17] helo=mail.holtmann.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT33J-008msg-TX; Wed, 22 Sep 2021 14:16:51 +0000 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 81392CED34; Wed, 22 Sep 2021 16:16:44 +0200 (CEST) Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] Bluetooth: btmtkuart: fix a memleak in mtk_hci_wmt_sync From: Marcel Holtmann In-Reply-To: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> Date: Wed, 22 Sep 2021 16:16:44 +0200 Cc: Sean Wang , Johan Hedberg , Luiz Augusto von Dentz , Matthias Brugger , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Message-Id: <88B71D9F-DA0D-46A7-AC42-C9A5E5B95C7B@holtmann.org> References: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> To: Dinghao Liu X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_071650_177996_7BC324F8 X-CRM114-Status: GOOD ( 10.62 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Hi Dinghao, > bdev->evt_skb will get freed in the normal path and one error path > of mtk_hci_wmt_sync, while the other error paths do not free it, > which may cause a memleak. This bug is suggested by a static analysis > tool, please advise. > > Fixes: e0b67035a90b ("Bluetooth: mediatek: update the common setup between MT7622 and other devices") > Signed-off-by: Dinghao Liu > --- > drivers/bluetooth/btmtkuart.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96CEEC433EF for ; Wed, 22 Sep 2021 14:21:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52905611C9 for ; Wed, 22 Sep 2021 14:21:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52905611C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=holtmann.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:References:Message-Id:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tA83A6/MhzQer4vm80h4bh5ZCkQh02YmD+CxORDRikE=; b=bH/fDA8oc6WgeZ si119RKFY48jjCrh/m2k+iAjVwKyhZjJhed+pp/CdYxCV9XoPgJj4kQBs+F/2ZZs9tN+F9/57meT5 RqpD1hxBcpJLFrPMGl5iFCVsnEHg6WHl0j0M+aT6JlQ6XpoeulunLDHycxRSSCSlVDwu5vhAm8pbx jI4eKmihD7M8F/KHd7hlg0sTSVA2e5FZ04R/mEL+z5GM1Y552IDXSnuw6K4Fkttii/J9UXHHm+miP uhZitB6eJ8imBdpkiNklbsvnshd9Fm6bKOM4MB6syaM1ZeG+Q5ptBflhd88n+7E5xBIW+TkTXhprs QdI6NcJ7JuJY2SQNJ7ZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT34m-008nEA-RK; Wed, 22 Sep 2021 14:18:21 +0000 Received: from coyote.holtmann.net ([212.227.132.17] helo=mail.holtmann.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mT33J-008msg-TX; Wed, 22 Sep 2021 14:16:51 +0000 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 81392CED34; Wed, 22 Sep 2021 16:16:44 +0200 (CEST) Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] Bluetooth: btmtkuart: fix a memleak in mtk_hci_wmt_sync From: Marcel Holtmann In-Reply-To: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> Date: Wed, 22 Sep 2021 16:16:44 +0200 Cc: Sean Wang , Johan Hedberg , Luiz Augusto von Dentz , Matthias Brugger , linux-bluetooth@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Message-Id: <88B71D9F-DA0D-46A7-AC42-C9A5E5B95C7B@holtmann.org> References: <20210922134945.27503-1-dinghao.liu@zju.edu.cn> To: Dinghao Liu X-Mailer: Apple Mail (2.3654.120.0.1.13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210922_071650_177996_7BC324F8 X-CRM114-Status: GOOD ( 10.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dinghao, > bdev->evt_skb will get freed in the normal path and one error path > of mtk_hci_wmt_sync, while the other error paths do not free it, > which may cause a memleak. This bug is suggested by a static analysis > tool, please advise. > > Fixes: e0b67035a90b ("Bluetooth: mediatek: update the common setup between MT7622 and other devices") > Signed-off-by: Dinghao Liu > --- > drivers/bluetooth/btmtkuart.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel