Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2221044iof; Tue, 7 Jun 2022 23:38:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4hWqGFoUAFsReWPYESbzjJx3QSYG93shB2XQ/FAhQ3YAc70eTfhoJXASINY5ElFSMaF4W X-Received: by 2002:a17:902:b949:b0:167:6548:2d93 with SMTP id h9-20020a170902b94900b0016765482d93mr19661961pls.131.1654670284790; Tue, 07 Jun 2022 23:38:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654670284; cv=none; d=google.com; s=arc-20160816; b=U6Io6w94yKtEiMgq0g1ZC1tsUUMYM/G8M4paJBq0ANH4XbPqwEPwAu3TdR0KKwjmOM 227hCwoyUWoLQRjrfxRsm5RBYD/GHxtfz0iDcT27gl35nVdIhb5SFoWUlm/X7gvOJOHC 7wWSagYfPquhGsN4VeEWahf8+A9quepKK5Do7DcAVckjJM3DX2k51bRFD4CQEc5DROMU l4FRON2osUacrWY2JOdq0PkppYzdZPEF7y0TujVf+SegFEnxp4NYHLpxCUOEzPXg3dbb b7yh0ODPCFYFvpGbd5xRvrMfRr5im+UW1DvHMU46EFlcDzNV1rDweXLLLE4bhYpLq9yC OS7A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h9zH3nf5LhpliZxEvCPkxBRG3nmva9OXxYK0mRWra24=; b=WOGGxTIjRR4Lxfa4D6ve37V3bqWioleJyimwvJGa6txMGIDDCyp3DX7SIOMOa1U5zR GRcN5nQzx8iT//zkgswpQSkm+MMFfYRkF18i/CygnsYF3WBBSR4TRSiIKjMmnOY4rScr sTomYm2cD7vPu+SuzGtgCmicpdWkrhTOyZTa/sATFiyCwqiNGQmwgpBivpTDG6/FgAbk 5T6+mQZWm1vDUfTv55PccUC41gUgE6DY25rDP5VKvD7NRPbcerrhvtb1jHRO1o0V9BZj NnzJwDAQGHG04FqrtLWkpTmBaN5TLcn+roc7DXWxdsMnWjHzNsBC6mOaiQEyA2c/qaYl MEWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tD/xz6q1"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h11-20020a056a00218b00b0051b8e74bc32si29238490pfi.169.2022.06.07.23.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:38:04 -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=@linuxfoundation.org header.s=korg header.b="tD/xz6q1"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 590B112E335; Tue, 7 Jun 2022 23:01:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1445008AbiFHCZC (ORCPT + 99 others); Tue, 7 Jun 2022 22:25:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444864AbiFHCL0 (ORCPT ); Tue, 7 Jun 2022 22:11:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB75B27B987; Tue, 7 Jun 2022 12:25:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A4CC611CC; Tue, 7 Jun 2022 19:25:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20C51C385A2; Tue, 7 Jun 2022 19:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629907; bh=8jYWGXjQor+G1kqnbPld+nkqp7LkRnwHsdy9bSzCSY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tD/xz6q1n2aH/RB/GxCF5o1aHzARMoOiySgzYSonzKEuELwxaSXjcTrAMJxOI12FX PCXHA4QACC7OqFpLXKABzTqD7YRya6JwEIFx7xVgmMiN3VvnpepDi2tdVPcKpMcRAv nRzZKi11G+13/bTFG1Xeq55EM5VD/2QfA1kCJNco= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alex Elder , Jakub Kicinski Subject: [PATCH 5.18 861/879] net: ipa: fix page free in ipa_endpoint_trans_release() Date: Tue, 7 Jun 2022 19:06:19 +0200 Message-Id: <20220607165027.847750783@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, 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=unavailable 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 From: Alex Elder commit 155c0c90bca918de6e4327275dfc1d97fd604115 upstream. Currently the (possibly compound) page used for receive buffers are freed using __free_pages(). But according to this comment above the definition of that function, that's wrong: If you want to use the page's reference count to decide when to free the allocation, you should allocate a compound page, and use put_page() instead of __free_pages(). Convert the call to __free_pages() in ipa_endpoint_trans_release() to use put_page() instead. Fixes: ed23f02680caa ("net: ipa: define per-endpoint receive buffer size") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ipa/ipa_endpoint.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1385,11 +1385,8 @@ void ipa_endpoint_trans_release(struct i } else { struct page *page = trans->data; - if (page) { - u32 buffer_size = endpoint->data->rx.buffer_size; - - __free_pages(page, get_order(buffer_size)); - } + if (page) + put_page(page); } }