Commit 9bae058a authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-ipa-fix-page-free-in-two-spots'

Alex Elder says:

====================
net: ipa: fix page free in two spots

When a receive buffer is not wrapped in an SKB and passed to the
network stack, the (compound) page gets freed within the IPA driver.
This is currently quite rare.

The pages are freed using __free_pages(), but they should instead be
freed using page_put().  This series fixes this, in two spots.

These patches work for the current linus/master branch, but won't
apply cleanly to earlier stable branches.  (Nevertheless, the fix is
a trivial substitution everwhere __free_pages() is called.)
====================

Link: https://lore.kernel.org/r/20220526152314.1405629-1-elder@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 4dc160a5 70132763
......@@ -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 */
......@@ -1418,11 +1418,8 @@ void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint,
} else {
struct page *page = trans->data;
if (page) {
u32 buffer_size = endpoint->config.rx.buffer_size;
__free_pages(page, get_order(buffer_size));
}
if (page)
put_page(page);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment