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 2E239C6FA82 for ; Sat, 10 Sep 2022 06:27:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiIJG10 (ORCPT ); Sat, 10 Sep 2022 02:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229550AbiIJG1X (ORCPT ); Sat, 10 Sep 2022 02:27:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 974E49DFB4; Fri, 9 Sep 2022 23:27:22 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 3196060C66; Sat, 10 Sep 2022 06:27:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 730C7C433D7; Sat, 10 Sep 2022 06:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662791241; bh=GXAqaX6S5isTiZevwTGC5NS6o9x12/MY1+Xsels5fyY=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=lLL3kBYo9Krm21ps6ucufzFryCtpdVR/tx8NS2P5vV+nm3W5ZYrTFqAb1n5ZayT/N 2jm1lz6nimtPoVCz7/IzDLBNU+3KmbRwJLnGBipLCcg/wY6qBIH2/qjrt6GSZafnel uFgOtR7c5oDco1ht0lLVaZMh6eLkK1d/p1oDhiKG+ttsr8rq4yn27n1uaS5x+Dxmq0 M5/LvQlzGOBSVzTr3WPBCeVBQfWmdOCNxkTJVlO32Sculj3kwoqFde+j6U9aj2NHxd e2QQ3yR31iMJ9xgv6acI3S8H3zeABvEDwW0WK4XgmuhwtiUHkRLmhMoojZ7UygSofl jR/WZa+xhla9w== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] ath11k: mhi: fix potential memory leak in ath11k_mhi_register() From: Kalle Valo In-Reply-To: <20220907073704.58806-1-niejianglei2021@163.com> References: <20220907073704.58806-1-niejianglei2021@163.com> To: Jianglei Nie Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jianglei Nie User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.7.3 Message-ID: <166279123716.2050.14052144817465731004.kvalo@kernel.org> Date: Sat, 10 Sep 2022 06:27:19 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jianglei Nie wrote: > mhi_alloc_controller() allocates a memory space for mhi_ctrl. When gets > some error, mhi_ctrl should be freed with mhi_free_controller(). But > when ath11k_mhi_read_addr_from_dt() fails, the function returns without > calling mhi_free_controller(), which will lead to a memory leak. > > We can fix it by calling mhi_free_controller() when > ath11k_mhi_read_addr_from_dt() fails. > > Signed-off-by: Jianglei Nie > Reviewed-by: Jeff Johnson > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 43e7c3505ec7 wifi: ath11k: mhi: fix potential memory leak in ath11k_mhi_register() -- https://patchwork.kernel.org/project/linux-wireless/patch/20220907073704.58806-1-niejianglei2021@163.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches