Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp978452iob; Fri, 13 May 2022 18:22:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWTy7Ww1gPnUh60drztkFZVcmKdrDND9NbNrZ0UM+vJFkjRsZvBYgrxlMIl7Kgp+N2yyOg X-Received: by 2002:a05:600c:2210:b0:393:ffb8:2985 with SMTP id z16-20020a05600c221000b00393ffb82985mr17051065wml.167.1652491376215; Fri, 13 May 2022 18:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652491376; cv=none; d=google.com; s=arc-20160816; b=emJQcGBLZ2F8wvDowsRj9YaCE8XOx9l8rIQTRvFjnH1NsON1GyXU28qIxr4ZbSPaId kYCywdJEnQj4T6JMxV4ICTOUF7iiGnGQdMdWnL2SDiiymQXWg7tE8Hi8d4C5W4unGDJM YRERifMaWHvKVG/tE8tgU/CzB3sRNPUwObu8tnjVAxE6DbtOt/7tWzf4QPRW0WdAyZTH mCWEXmXVOEeXyi0elu8DLJnPqCfEaqrXVLr/XlefwxH2mMBtDqYQIg9YmEH0sMPqQg3R jpmKdOMdgyot1Cc4wSG3nChqpMIVXI0TV0O1O6lL7NKY4Z0y0fnFU7ecTaTCGEG6MAaw 1cjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/OaoAYNGeTkjqRpT9BXELSpZRhtmoluGTZks7oz+u3I=; b=ucjYkjE8WarJnB9im7dYDv6pffq1oudCAbSKjckx/R121QAjdvK491VqSuNzQJCPTr vbV6ja8dRq1Ke3Jool3LE+Gjh0cNuOcwKtSjaesdECVMSX84OsJlu6aPjPnt8eSkVVr/ tH6g5ywT6T14NmRATght9MjwQqUeDzhP5PGj7woR35fV2dJL7KWDc8frAGWM0pmxnXao dLJUhlkK8uLuO93pfL36Pa4X8FaqP/C/+Z0PkmAIfrhCTfM2ls9L2CMPuhDnlBNSRwc7 kt6tZKxONw5PoQVnYH0mHSJ88hl28fxdJKqEzj/Avmy6PKNl9RaaHDG89gBI1FTZdtFW V3MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@georgemail.eu header.s=DKIM001 header.b=oyxTOcNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h1-20020adf9cc1000000b0020c5ee0ab6csi3428891wre.314.2022.05.13.18.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@georgemail.eu header.s=DKIM001 header.b=oyxTOcNn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E47A3CF6FC; Fri, 13 May 2022 16:52:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379735AbiEMLGS (ORCPT + 99 others); Fri, 13 May 2022 07:06:18 -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: 8bit X-Rspamd-UID: b6ee6c X-Rspamd-UID: 4a24b1 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, u64 index, int length, } if (!bio_add_page(bio, page, len, offset)) { error = -EIO; + __free_page(page); goto out_free_bio; } offset = 0; -- 2.35.1