From nobody Fri May 8 01:40:18 2026 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 0C7CDC433FE for ; Fri, 13 May 2022 11:06:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379742AbiEMLGT (ORCPT ); Fri, 13 May 2022 07:06:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379732AbiEMLF5 (ORCPT ); Fri, 13 May 2022 07:05:57 -0400 X-Greylist: delayed 503 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 13 May 2022 04:05:53 PDT Received: from smtp6.goneo.de (smtp6.goneo.de [85.220.129.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BE33DEF1 for ; Fri, 13 May 2022 04:05:50 -0700 (PDT) Received: from hub1.goneo.de (hub1.goneo.de [IPv6:2001:1640:5::8:52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by smtp6.goneo.de (Postfix) with ESMTPS id E2CB010A3329; Fri, 13 May 2022 12:57:22 +0200 (CEST) Received: from hub1.goneo.de (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPS id 49F2210A1E8A; Fri, 13 May 2022 12:57:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=georgemail.eu; s=DKIM001; t=1652439441; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=/OaoAYNGeTkjqRpT9BXELSpZRhtmoluGTZks7oz+u3I=; b=oyxTOcNnpA7wvYA8hX8Kszx8M5qhGFlS0q2v+c+mbP1hL4iebb0Aw3naz2QHlLrSSDHDI5 5cwCBrorgj0DfHRxeKyivLA8u50MrxEDKpJ0AaiOpZQe2WbODIRS96oLCms8Ua5rzunQGg tBdaqtXuaRDkiaYafkplVbPI6WEYCgZtB7wFFPqPoWpNGFNVlJChQEYDoQ0ml4586W2JK7 BvoFbA3EgCxvsm0byojsoxx8S9tgMytvTAhJXqlE8s3JTsol1zDb78bilbrg+o2ZU0zOGV iDBgy+zQFEab5S7ZF/06gXO7An4vPTXL13/A8U5jA0TEf8vGIH1t9cRhExMdHQ== Received: from brot.fritz.box (unknown [IPv6:2a02:908:2a43:3560:cb6d:eb1d:27ff:405a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by hub1.goneo.de (Postfix) with ESMTPSA id 0469110A1E87; Fri, 13 May 2022 12:57:20 +0200 (CEST) From: "Leon M. George" To: Phillip Lougher Cc: "Leon M. George" , linux-kernel@vger.kernel.org Subject: [PATCH] squashfs: free page if bio_add_page fails Date: Fri, 13 May 2022 12:57:09 +0200 Message-Id: <20220513105709.2209247-1-leon@georgemail.eu> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-UID: b6ee6c X-Rspamd-UID: 4a24b1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In squashfs_bio_read, the page recently allocated for use with bio_add_page isn't freed when the call fails. This patch adds a call to __free_page. Signed-off-by: Leon M. George --- fs/squashfs/block.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index 622c844f6d11..5ca1c9caef7d 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -110,6 +110,7 @@ static int squashfs_bio_read(struct super_block *sb, u6= 4 index, int length, } if (!bio_add_page(bio, page, len, offset)) { error =3D -EIO; + __free_page(page); goto out_free_bio; } offset =3D 0; --=20 2.35.1