From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAB70330668; Thu, 22 Jan 2026 02:02:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769047361; cv=none; b=gZG8QrWZDTZPFwQ+iNMyYuJ4saHSYqXiqJeD6iIoLaaZuQtojU74q2EdbRGR1ZU0V7piR/CcTk71wwgBLyYJMxRIPrC2WU/pyjJ73JeHaa1EBfzO1HF5XoJjgRNHfuZyDeb1Zci3Z9GQJ+OWe6HxvfW9q5OF71PJ00/JipHAHoQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769047361; c=relaxed/simple; bh=LxIu0lsQehb7g6iEFX1+f9XxUFTJPKJQYl3Dpy8Skm0=; h=From:To:CC:Subject:In-Reply-To:References:Message-ID:Date: MIME-Version:Content-Type; b=Yp71afXKnTcJcYviHRZGWo0Ds6tGAImHG7GVVk1dAk3WXfGzuSlrR7mGDXltaKmgPLG/nWIO3OKzDlmLSCYdIPfqRUK6oeZ0IVb9YD3qF4EOmsMExS+69CjliEpvR+jU6EmPjYkgrHGIqNDkFb2/UvBCaYQFLlfLfYEP2BaD33k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b=i+fwUlna; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.b="i+fwUlna" X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 60M22ZmyC108566, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1769047355; bh=g/miE1dO+azRTIt7TQpeeBnWnfJOCUHCHnHRCpVDquo=; h=From:To:CC:Subject:In-Reply-To:References:Message-ID:Date: MIME-Version:Content-Type; b=i+fwUlna6xALZhXbfTiVk5i4oO0uKka+4W2caEqqXhKuPBQEmpf7GA3wCVqUWizKf iU2zrBYiT3G8EeC1x4k3A5v38CCQFktlRG8VDg4TAB5nkoSpACWEQiNILd+3okVoUd D98MP8EZsukuA6dKnUsB1iqUjzcfQ3TnQU0MFhqBGJmumAKRQJzJ4Ma+PyCQorKI8S LJs2eXrrOaV3ZtYiY9pV1HG8meJLwaacHQUWmTHgNlak7iak/NWLMbGDzczTGTBAtC su4vAusqymkSdleyiTNc27Hs7lJmPDtWSQyTBELJBYeK1TQtV2SSjUz132zc82f56L KxpjN+/WSMIlw== Received: from mail.realtek.com (rtkexhmbs02.realtek.com.tw[172.21.6.41]) by rtits2.realtek.com.tw (8.15.2/3.21/5.94) with ESMTPS id 60M22ZmyC108566 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jan 2026 10:02:35 +0800 Received: from RTKEXHMBS03.realtek.com.tw (10.21.1.53) by RTKEXHMBS02.realtek.com.tw (172.21.6.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Thu, 22 Jan 2026 10:02:34 +0800 Received: from [127.0.1.1] (172.21.40.75) by RTKEXHMBS03.realtek.com.tw (10.21.1.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10 via Frontend Transport; Thu, 22 Jan 2026 10:02:29 +0800 From: Ping-Ke Shih To: Zilin Guan , CC: , , , , Zilin Guan Subject: Re: [PATCH v2] wifi: rtw89: debug: Fix memory leak in __print_txpwr_map() In-Reply-To: <20260116130834.1413924-1-zilin@seu.edu.cn> References: <20260116130834.1413924-1-zilin@seu.edu.cn> Message-ID: <565d54c7-a2d2-4aed-8389-9df4303afae7@RTKEXHMBS03.realtek.com.tw> Date: Thu, 22 Jan 2026 10:02:29 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Zilin Guan wrote: > In __print_txpwr_map(), memory is allocated to bufp via vzalloc(). > If max_valid_addr is 0, the function returns -EOPNOTSUPP immediately > without freeing bufp, leading to a memory leak. > > Since the validation of max_valid_addr does not depend on the allocated > memory, fix this by moving the vzalloc() call after the check. > > Compile tested only. Issue found using a prototype static analysis tool > and code review. > > Fixes: 036042e15770 ("wifi: rtw89: debug: txpwr table supports Wi-Fi 7 chips") > Suggested-by: Zong-Zhe Yang > Signed-off-by: Zilin Guan > Reviewed-by: Zong-Zhe Yang 1 patch(es) applied to rtw-next branch of rtw.git, thanks. 6070a44051b1 wifi: rtw89: debug: Fix memory leak in __print_txpwr_map() --- https://github.com/pkshih/rtw.git