From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A657842884D for ; Thu, 8 Jan 2026 09:17:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.251.105.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767863842; cv=none; b=MT5bQ/hLgF57aly5a/GCfNRQ0YlfHOI+/M8gKKj6h8vCqHAWue+Mu1EGdMxdqnYCGRRK33EwWLVJruo/bouFGcpLUTkzlSEEcRp9+r2ie5TlK8IRVee9Cn2LVan99aQU+h1cMWIcitTDs9Xnu90XMzMMr/t/n4pGxM1RZ/j7i+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767863842; c=relaxed/simple; bh=pf1GMbVTykZwhfXBrZExf4VWzpjh5hKk5lemY56B1oc=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=kJ2gtgujrRWE7t2qqYkMYymnKMjFoxMyakeRQIbq0xBI8kIXobBA5ZTk/84X5+UYaj+lnowSbwd5qRozvJslT/T0oqVGPk/RKRcz+HQEhezSI3VBMrzc5msYwjnCSf6mh+aF8LLXrgW8t+qDCUDJ19TqQ3tuiE3F1rDhBWH1nPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=IwgIcuBD; arc=none smtp.client-ip=148.251.105.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="IwgIcuBD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1767863819; bh=pf1GMbVTykZwhfXBrZExf4VWzpjh5hKk5lemY56B1oc=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=IwgIcuBDhAznIucBWIlQUrV/YF0Ifsmu9P1uNUD44NDsCwNXwEhlHZfoVasE/CZBH xMyK9pkZ6KbLswJSW1F7cZUDOfkpxb3rIsavS2QiMPyKJcHkSqapge/jL8DTV/0GF5 B6Ihn373AWfeq+jJmQMNVaNnv03pNt9Dp5hOVKwEfwXt7X3QhfG3uj5N4LyS33OoRR fC+gT9ujB5Urv7/m1qPZFXiVuhlafXMK4pY3bSXQdIXUglUqW0KkpFDJcJ9uW0+pzk EGRdY3qjjxqPpdKE9qSOFiHsnffdGbZkM9BuEijHKkfsoVckJDkFS2oRUpt+jGhS79 5AiJcxoUNyQbg== Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by bali.collaboradmins.com (Postfix) with ESMTPSA id 5B08717E11FB; Thu, 8 Jan 2026 10:16:59 +0100 (CET) From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com, Zilin Guan Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Jianhao Xu In-Reply-To: <20251228162636.3829733-1-zilin@seu.edu.cn> References: <20251228162636.3829733-1-zilin@seu.edu.cn> Subject: Re: [PATCH v2] soc: mediatek: svs: Fix memory leak in svs_enable_debug_write() Message-Id: <176786381930.9526.15054540392000699829.b4-ty@collabora.com> Date: Thu, 08 Jan 2026 10:16:59 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.14.3 On Sun, 28 Dec 2025 16:26:36 +0000, Zilin Guan wrote: > In svs_enable_debug_write(), the buf allocated by memdup_user_nul() > is leaked if kstrtoint() fails. > > Fix this by using __free(kfree) to automatically free buf, eliminating > the need for explicit kfree() calls and preventing leaks. > > > [...] Applied to v6.19-next/soc, thanks! [1/1] soc: mediatek: svs: Fix memory leak in svs_enable_debug_write() commit: ebede2ddeb047bdf7ee660a18403592c45d020d9 Cheers, Angelo