From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 10D21334C39 for ; Sat, 7 Mar 2026 17:12:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772903524; cv=none; b=I9N+VUFgkUESPbvcr9Jbncl/grzUNgMArQl+7SYAyIzLe4+7k+/XIeNqxyzgsXUs2ZDuKi/JvbmBwTDZna42+QlcPuh/krLo+PdGa6gAV3a3VxwJaIyIIzxkrpKha58kKKo3aHG02FCVTfNargT8PiedhN3w8ZBmNZrcf8X+0Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772903524; c=relaxed/simple; bh=1StzVL8Mg3aXr8dy7+syp1qCyIZrwfvXPoVQ1t0ORTU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YkWXjRoGzqR5Y4XjAnxUZ6UDnfWHsqlGzSf5yPPYFU1SG/Fd5YCkA1H5RlsuSuOTXkBQ8Pf+Na7GSUH1CI8MbC1j/DSMBZTsz3SAYTsHCyq0djVoZ1l2+FXc7Gv1JA5PKuf5xvPazTsv01Bn6nPIZ7uOkaDWg1atZ9lIE4ySk2I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LdMpsluK; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LdMpsluK" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2ad9f316d68so45367605ad.2 for ; Sat, 07 Mar 2026 09:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772903522; x=1773508322; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4gPW5A+IYSR0nmfrxCQ69lwC/wkh2GiNg3Ikcs6no8A=; b=LdMpsluKKVKDcf/B+KN8mqLCopsfOlWs/oA4qmekaKvQ/0q4wgnGdIG48jylu52SkP trMCl/HYyhBbYEOoEUC+caIxLnvbkIxnxa3D+24VxreqitFipP7JglRt1EETMdXff3lX IVIpRdHAbCFUpz1cygDf+YEgXsZppvnNW/Xen0r+iJAXmENNapPAW1kASp8+vw49paaC jKD3POG5JGWGZ92UbYpD4T3FJvqwl5fVuee+e1Cxxas2fib+NTJep3mORp5HWFoNoSdF caWqhLE6T9qXa6IRH+99qoL5KijWcxcaBJUgwJ9njOWguct62TRO4oncEzmzfKQO7QS4 UNIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772903522; x=1773508322; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4gPW5A+IYSR0nmfrxCQ69lwC/wkh2GiNg3Ikcs6no8A=; b=UKwUapSRK/zC+mC0Qbuvja74t1EIxJpqGzhFG93G4I7Ma1YL0ZRuRVQ2OtAY13aOvB lxHdN0StcNTRB2NIFM84YxGxamx0hmfxQHVqkwOavg4XwY2WnAAwXomt8Vw7Ps/wBhoZ /nknhcBjs+OQZcoYB5SJGZGDJRJuBhx3SMoyFdnPVN6Z2YrST/0K3CU2c7L3yGeKCtvf I8RQAhHaBLVFbev9w73RVoY9oCid8RnKGoy+4ou4ajqlmpUXiSkk0+fRHHiShGliS3gs uxV9gvdhGdsdJztF1u1Ko5vs06XNonXiuuBuXFx/yvPNuptg56Oli1RzC65kBhWM2X4G UpdA== X-Forwarded-Encrypted: i=1; AJvYcCUYRGY2yGOfNw/eO9RQtLQNagASPO2+hXE+QKKeomm4i/k9cVRsdks/rebrUe4darTtYExS6xR6SxoNmpE=@vger.kernel.org X-Gm-Message-State: AOJu0YxRXu5Ky6Qn57Tm+VW5I/t3Sg/puAW1XD5yAvbfFb0zvzYnw0yo iisbWJ2aQJtvP8Qz32ht1860/JmYIgAB+s3WuXGidYzuFxA13kBeHvu5hwNYq1My X-Gm-Gg: ATEYQzyeBq/5APXBRwM8BHXavoivjNpZKaR4hJJsfDdu6dhYyRHtlElRpCVmo5a08xe 2N3tGShXH21Lg16o3W/yUI7Qb+AYZ0/1vzf1EdKUr/oEg+vDcZE9MyyybMU9Ve0/yjQU7avXa10 /vSxb5FKe3ZEzVn7V5Pjt95SLLEpr88i1mGesB8KiabinYhi8+yvDOKTwDMBq00qJvi/E+qa4EL NlYpRbsgenbY8NRA1mBt/qSH/vH2YwIHeBT6WgxLpdjJM3LsLRfg+xhXFeI4LJ8xGfZmKFtkoWP eCYRAA5/Stx3zvti6xeVBwsW3HHEyGLQAPZ0i8kRuM0TcqPa3miFXjHlLAibJiTL3jdmjrpAuvG No7N8KbOfNN2sAXdoMbPQ2V8AlajnpMMEMT3mKffRvJQqLqb81Koo76OE2ZqPEQIdUIHLn5cpsH +xecl0DlY9y7iBYt2vceFAKvT1iT9BevEUg3WVJ8uRKXXbvaoAh3VunV/Nqb6AwDQX+vU= X-Received: by 2002:a17:903:110d:b0:2ad:da28:98d with SMTP id d9443c01a7336-2ae824326cemr63470065ad.37.1772903522217; Sat, 07 Mar 2026 09:12:02 -0800 (PST) Received: from google.com (61-230-19-63.dynamic-ip.hinet.net. [61.230.19.63]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae840b6639sm80879085ad.86.2026.03.07.09.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 09:12:01 -0800 (PST) Date: Sun, 8 Mar 2026 01:11:58 +0800 From: Kuan-Wei Chiu To: Josh Law Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Josh Law Subject: Re: [PATCH] lib/inflate: fix memory leak in inflate_dynamic() on inflate_codes() failure Message-ID: References: <20260306161647.2811874-1-objecting@objecting.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260306161647.2811874-1-objecting@objecting.org> Hi Josh, On Fri, Mar 06, 2026 at 04:16:47PM +0000, Josh Law wrote: > When inflate_codes() fails in inflate_dynamic(), the code jumps to the > 'out' label which only frees 'll', leaking the Huffman tables 'tl' and > 'td'. Restructure the code so that the decoding tables are always freed > before reaching the 'out' label. > > Signed-off-by: Josh Law The change itself looks good. However, IIRC, this isn't the first time I've complained about the following checkpatch.pl warning: WARNING: From:/Signed-off-by: email address mismatch: 'From: Josh Law ' != 'Signed-off-by: Josh Law ' Regards, Kuan-Wei > --- > lib/inflate.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/lib/inflate.c b/lib/inflate.c > index 5b1e70d0ce8c..ae704e4f64ec 100644 > --- a/lib/inflate.c > +++ b/lib/inflate.c > @@ -1009,10 +1009,10 @@ DEBG("dyn5d "); > DEBG("dyn6 "); > > /* decompress until an end-of-block code */ > - if (inflate_codes(tl, td, bl, bd)) { > + if (inflate_codes(tl, td, bl, bd)) > ret = 1; > - goto out; > - } > + else > + ret = 0; > > DEBG("dyn7 "); > > @@ -1021,7 +1021,6 @@ DEBG("dyn7 "); > huft_free(td); > > DEBG(">"); > - ret = 0; > out: > free(ll); > return ret; > -- > 2.43.0 > >