diff options
author | Jakub Kicinski <[email protected]> | 2022-05-27 18:29:53 -0700 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2022-05-27 18:29:54 -0700 |
commit | 9bae058ab57f88c7c1ad61797ee16a5abeda42c2 (patch) | |
tree | aded95c52a9545597adfef63abdc7af531efeb12 | |
parent | 4dc160a52da1330d54d561f9dac8a9e0ef333895 (diff) | |
parent | 70132763d5d2e94cd185e3aa92ac6a3ba89068fa (diff) |
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/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r-- | drivers/net/ipa/ipa_endpoint.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ipa/ipa_endpoint.c b/drivers/net/ipa/ipa_endpoint.c index 385aa63ab4bb..d3b3255ac3d1 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 */ @@ -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); } } |