Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1003432ioo; Sun, 22 May 2022 00:06:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5xiKgqDMyUSLNrrgLW/ZJE7I99j3wS3h5ZM3x+lp6ay814+a9XcKwkR96szJmIoNfpdtY X-Received: by 2002:a17:902:7447:b0:161:e79d:6bd5 with SMTP id e7-20020a170902744700b00161e79d6bd5mr13535898plt.139.1653203180805; Sun, 22 May 2022 00:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653203180; cv=none; d=google.com; s=arc-20160816; b=j9CK32rkdeZ8FcD4+TAxfGa/5yvtkWiy9QgjbCKUlYvjVy+BsS/f6i9m43e7MjUWsU lCuf+ErBHjzynQsumdo8SKDQ0iyneF0gQXf1+ZsOAqP5MImGO4hZAaBOIs4VfpAgTHaD nRixmLCZa5/pKOqxEk0uumajThnCUTZBrdL6Pil3pPoV2U0flUH7An2UI6MkPUOwWCAi jA+r1xFUcwsJpJCTfmmeTAwTMi1BfAQwv6vCJXYChb3P3ve/h1vsjecycs3U+KadgSV9 aeySl0oCvp8j0BOY+cFi1j+IcwYPmawg63nz38aovMHwfyiC9n/FuvAEfLVmki2/wzNr AItA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9nHOW+mnraB1XiSAtyqCqOmXRY0ima8MXF2hLYPrgyI=; b=xILu/YtT00uqI3iEOhvn11QmQeQcW1tkJHe6oys1uCmV8VtVJio0NrdFg+5mz0Ay/g KeXwhjUbnSwn1gUNXZvUU+3z11yFN1X18lvdla2tzZl2DJdyE8eUikpBzciA4WYFZXND +uxt3fuSj5cNNZdk0oVj11U1pEVQsIdqeqmpyRqiXyyoTJngvElsYEdqV+ze49zjU1Wg GTXxGf/qZ+Elzm9EXyem26cd3/oR10JJ4Ek8jj2WKMBRhMBn68KkN8n2f5si5AmMyAyJ MT80NNys+t03vgxLFaanOcWgl+Rt31NhafxcgsJu9hbJMPEBjyjoOvvh9aD+2aMIDrtg BZjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tpNTJG3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my1-20020a17090b4c8100b001df51cfa5d5si9559834pjb.99.2022.05.22.00.06.10; Sun, 22 May 2022 00:06:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tpNTJG3y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348746AbiEVBAP (ORCPT + 99 others); Sat, 21 May 2022 21:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343829AbiEVBAH (ORCPT ); Sat, 21 May 2022 21:00:07 -0400 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5003239820 for ; Sat, 21 May 2022 18:00:06 -0700 (PDT) Received: by mail-il1-x12e.google.com with SMTP id b11so7720715ilr.4 for ; Sat, 21 May 2022 18:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9nHOW+mnraB1XiSAtyqCqOmXRY0ima8MXF2hLYPrgyI=; b=tpNTJG3yM9Wz/y9QSl4vuGOCtsfjCxWgtWGDVssv2nSWwap6tnYkjE8HfUean1dleN xao8+lCvbkVBReXqb1FDVdzUz8N+P7BF8zrKfOipG7X45gGqumqVdxZUNhFSQd+yk1Uf zodhLnVEiarAswjBaNTIezlIOtclDKLgXqCgycRjD8887HkF5YKXNvZ1qCipPZe8/2Xj SsxuH4CBqBeUW1Fg6c5bX2u/Q5HQIcJiDuvd+mYET2DKDkN1GjIbxX7jPa1r3R5sb3xr 2EtxKFFVq38XsoVqRhd/t91Mb1It69uN6czQ8Euhj7pM/Duc3jEKTq9J7uwNiLntEukn 1g7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9nHOW+mnraB1XiSAtyqCqOmXRY0ima8MXF2hLYPrgyI=; b=FhGU3h8TaUyNcZPyghOchZ/bS5W1zdvOg91jwhZQi7icUsWt/IL18yJ1fzEWhuBUWp gyEhDwd6p4Yf7saVI0jgZVNbOvptxF8OiPeR+DhZFdLaOGjd1CvKa1qr498fY/20uHqm srpLfvYcIJprm6S4xbGCbaqAbzaGktLi7z1GB8W6TgG7QBSwfROrByVsyXxBgc3AwMjo MLX/FTNj6cPN8+JuPN8fmD3dDHsJT1TBLNykUQ7Gv1yQ00hDkL/Ddi/UfONZOK8SVghQ hbkW0BKfmvHXAXLDDlaAvcarO5KEtfJTOhmAus6sdYwmDwDBqp8eK8BJOfkrGJ13kwDT /wyw== X-Gm-Message-State: AOAM531B2CwBll2WCEI5opCBGuxQ6iSSWBTDxz2XltBtKPfSQVqNAuI6 08095Qc5gi1G2dDvfC0h0IoFgw== X-Received: by 2002:a92:d486:0:b0:2d1:19cb:9eba with SMTP id p6-20020a92d486000000b002d119cb9ebamr8075908ilg.29.1653181205689; Sat, 21 May 2022 18:00:05 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id t21-20020a02c495000000b0032eacab7e07sm939366jam.93.2022.05.21.18.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 May 2022 18:00:05 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, bjorn.andersson@linaro.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 2/2] net: ipa: fix page free in ipa_endpoint_replenish_one() Date: Sat, 21 May 2022 19:59:59 -0500 Message-Id: <20220522005959.1175181-3-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220522005959.1175181-1-elder@linaro.org> References: <20220522005959.1175181-1-elder@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 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 --- drivers/net/ipa/ipa_endpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 675b7135644b8..dac4845cf596c 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1062,7 +1062,7 @@ static int ipa_endpoint_replenish_one(struct ipa_endpoint *endpoint, 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 */ -- 2.32.0