Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1551617ioo; Fri, 27 May 2022 10:55:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR64NIy3fJrdqFv8TGm9lfUlXaojrfCd0dMtJ/Nk1z09WkMQIyCPY4CI3+st19v13ZRKgK X-Received: by 2002:a17:906:dc8a:b0:6f9:13e9:4c87 with SMTP id cs10-20020a170906dc8a00b006f913e94c87mr38802503ejc.729.1653674130646; Fri, 27 May 2022 10:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653674130; cv=none; d=google.com; s=arc-20160816; b=KuV1zTSvHUikBESsoSXldMFJSDk1Yny9Xt5d8geVJ1A+TXsADXu91yOnv+X//KijNm 28TqBjwSZwYSLP7y7bZhzm3Fy02zCkIupirVyqrqOTk/b7UY7qsTFb+bp2T89N0FR/+S l1UQOh6GaNzixbaazTzN72r6KNKXcyLvtutOP0PzYBb0tTxOYnMtBTXuQj2s7Qzlse1N JaaJKXCo+9CabC+VmiKJZxSbltE1P3Jy3JObc8B/1umiuaMWMuqjj9LnzNMjumD4loVA /wyJ4aufhKFx9OU+9Q9/kzKgVYUZHuwYuREGZgSpOdk6zYc9YpzBiFf5u5Mjtxte95sN XGyw== 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=wgV5WDhxmD0Dnlf3qJjYbgrRUn1OQnaRM9u6zB4EPj0=; b=CzsgzvTQpLnlkLPC5h/EJn/14MgsLhsB33Q/GL2/wLja4wbfSGnvEx9c5s2kcHj7Gs HZIUztDdSGW5z1uN66UWtD2XB64+w6wgZ95A6TvjOTANPG4+W8kfdWkIRygu7VJGNdRg 1hvWbWt2K+vAiA7V45ffbnIFx9vvDxOsjDQwOhKY8tbduGGxImcHAOCHGn+GjNqc2NuK UPDS9pBXQr6g5keQuS405OrsoCVwkJg1TLOL5zhiFVJZJ5etstHAWvhairDHvhYZi+hl wKjgpMZ+Cg/MFU8VAl7kKjLijFxmz9eI1wTJlQJuMkN55A0p0st9kglhUBkNHAIgHthj Lc5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IToBwRVL; 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 i19-20020a05640242d300b0042baca38617si1747684edc.89.2022.05.27.10.55.04; Fri, 27 May 2022 10:55:30 -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=IToBwRVL; 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 S239434AbiEZPXe (ORCPT + 99 others); Thu, 26 May 2022 11:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243809AbiEZPXX (ORCPT ); Thu, 26 May 2022 11:23:23 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 111AF41308 for ; Thu, 26 May 2022 08:23:22 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id q203so1934765iod.0 for ; Thu, 26 May 2022 08:23:22 -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=wgV5WDhxmD0Dnlf3qJjYbgrRUn1OQnaRM9u6zB4EPj0=; b=IToBwRVLrMfLDIr+YkgYZKo8kZX1EPcQ3otjSZJwsbE2mnnYVVMzCor7Z2y3464Ndv uZMezsTJE2h3v16QLMKPwdYP1RuyNXo92U8i0fVWOevhQqqqnjBIwQSDSSYmqabH2vYW LLqxri3IE5rLz6/x0vLp/+ymd4p3tpoAIOUIk0ihH0ZiTVNdL2dAfoF7H2EuciTVWZNA uwHcGax+n8ofHSnCuYoc4n1M40JC+FMpSbMLzvD5fP7YRX85UtUCT4S0pWL0ZkMZ3Sa3 g0C7uEfYPQ/i+vKS3hDZknB4x0EJD/FYdUQZ1uZ8fAcpza125jtsnaYtIFmJxGUgRxVr b1wg== 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=wgV5WDhxmD0Dnlf3qJjYbgrRUn1OQnaRM9u6zB4EPj0=; b=GHLs0qnr5w+rnvZ8n4Cq85jW4ETdvzI/FTXkUhSN1uT6XBuWFhNK7bPldqChDq3/MM XLL/XKiTnN9May9eDOiD4Xuh1kPQoYqoen+uTHkmH6g9xIOYC5LPJFmUxhmPZrAM7CZF qpJSUR7Dz+oca4HIwSOujWu6BCcZYw/jIbb6smsD5WUdUWGGHXA4LOrgcsDHR9WwM83T +W+qJNhWFn9M8MU9mVIm5v65LS8+3LWFRkVsf6q3cGp2PkwRD1w7JPCxEb5NgHfQBWYE FeDmoXhrYq9dYLv63ZB/zIrq+w95ceAsKD34zB6vXHYfPJhSSXHlYrPeh2iWDlir6LzZ A1Qw== X-Gm-Message-State: AOAM533+IQ6hSt5hOMRF+6IXZrkUXVFyHLKGkCsayTFBKVr+AYYR08kW J6gfzZuzcNI2lmiHOKAFhhC08A== X-Received: by 2002:a5d:9448:0:b0:657:24e0:c0b2 with SMTP id x8-20020a5d9448000000b0065724e0c0b2mr16683401ior.167.1653578601430; Thu, 26 May 2022 08:23:21 -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 b59-20020a0295c1000000b0032b3a78176fsm466847jai.51.2022.05.26.08.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 08:23:21 -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 v2 2/2] net: ipa: fix page free in ipa_endpoint_replenish_one() Date: Thu, 26 May 2022 10:23:14 -0500 Message-Id: <20220526152314.1405629-3-elder@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220526152314.1405629-1-elder@linaro.org> References: <20220526152314.1405629-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 e92aa9447f6e7..d3b3255ac3d12 100644 --- a/drivers/net/ipa/ipa_endpoint.c +++ b/drivers/net/ipa/ipa_endpoint.c @@ -1095,7 +1095,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