Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2219830iof; Tue, 7 Jun 2022 23:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgR2ePNkSCcdqGKWQxVj5ab0YHvQ2yfgk5qSRrlrVhiPRtazHfEMo5GX5FHSVLECKPyI1F X-Received: by 2002:a17:90a:4209:b0:1df:b907:ed3d with SMTP id o9-20020a17090a420900b001dfb907ed3dmr36542738pjg.40.1654670158409; Tue, 07 Jun 2022 23:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654670158; cv=none; d=google.com; s=arc-20160816; b=JgvrIUF1lEMYtKPQpCFU8tVSmkAOoc2tVMEXS7OMghx+OYdiD1oCVs+hrCp0tJKYs5 BVIhaE0ZZkvEcvqpAau3xV5Ujjbzyd4mAaUmlg1LCvf57sYlU7FUErGFyx7SYInuVeW0 oB45mFps5hw1xvtNZ1c3uJtTzXem+i/MzbUBjdIYdVzO/zyxOa2mxLD6rfnO3A30vRYq 1NDe9DBEcb2RtdyVdwbqy9UbyvQ3o2R+fmW//UoGoNF/tmAgHuUB82ujvTp44jYDJ8ts UqG6sR/03k+ek0VUVTvm5u61lTaMiH5XodrDeMTgNuqGue9NegAcKp3kzKa9myl8gnXH RB4w== 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=K3OBjaLyZVqcMJK0alT1kAEyUfUMTQEBWl8fQTBoKP8=; b=D3fnu8HpvC2Sn8DeuR2qKYPG4ENgo5xDl942iXBDXMIN4+79iQvEd4iApkpHyjbDjN 2D9JOXRFJCFrXLFlTAV+v0w5siMzcfxWDPTpUJT3ppFi/7P41/NQEnTxOHlbCXg1VoCC XZ3SNqNsNX0Pkh80RMnMygLIlXOi2duvPonh8Dt376Za288BVgGdgzVr3Fp2SqOJfRVq awVC4KbCnG01aoePGd3nX1stPNxi8AS1WdUaEbmrbiRdA3etFWvqkBBkn6rgH6A2+4uh 0X73Y9HCTMKHu7Zwlec37DRycXKZO0t562mPnJIYHftzSduOTW+/TtoM7eLDOtr8Zsi8 XHXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KWjPsuoG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id a72-20020a63904b000000b003fe29d0c24fsi2216976pge.71.2022.06.07.23.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:35:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KWjPsuoG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 45910A7E11; Tue, 7 Jun 2022 23:00:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiFHCXA (ORCPT + 99 others); Tue, 7 Jun 2022 22:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444868AbiFHCL2 (ORCPT ); Tue, 7 Jun 2022 22:11:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C430927B997; Tue, 7 Jun 2022 12:25:11 -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 4C7A2611D3; Tue, 7 Jun 2022 19:25:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2322BC385A2; Tue, 7 Jun 2022 19:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629910; bh=whKsu2kQ5R/kSc9mTeCeMK1+7GSKVLf+ZR+OdqXreFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KWjPsuoGwCRGEvVgC4uG5BeESN+lPr5UUY8GjH87popIxkEuHc8jKFddlWQdMJe91 TPVCXOBIGWsok+uA9qCL1vM7yo2q89nKBH6/FXDywgcpZhm91MwvaTA6t4oD6L02/3 u7nr+VSndhubdTpyikoqQ1ZbDjJ0S68bXV6TZRy4= 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 862/879] net: ipa: fix page free in ipa_endpoint_replenish_one() Date: Tue, 7 Jun 2022 19:06:20 +0200 Message-Id: <20220607165027.876591870@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 70132763d5d2e94cd185e3aa92ac6a3ba89068fa upstream. Currently the (possibly compound) pages 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_replenish_one() to use put_page() instead. Fixes: 6a606b90153b8 ("net: ipa: allocate transaction in replenish loop") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ipa/ipa_endpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1062,7 +1062,7 @@ static int ipa_endpoint_replenish_one(st ret = gsi_trans_page_add(trans, page, len, offset); if (ret) - __free_pages(page, get_order(buffer_size)); + put_page(page); else trans->data = page; /* transaction owns page now */