diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2025-06-17 18:42:48 -0700 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-17 18:42:49 -0700 |
| commit | 0aff00432cc755ad7713f8a2f305395d443cdd4c (patch) | |
| tree | 28aa7e7d9790d9bcd53373974d42591089c89de8 /include/linux | |
| parent | 6dbb0d97c5096072c78a6abffe393584e57ae945 (diff) | |
| parent | 7851263998d4269125fd6cb3fdbfc7c6db853859 (diff) | |
Merge branch 'atm-fix-uninit-and-mem-accounting-leak-in-vcc_sendmsg'
Kuniyuki Iwashima says:
====================
atm: Fix uninit and mem accounting leak in vcc_sendmsg().
Patch 1 fixes uninit issue reported by KMSAN, and patch 2 fixes
another issue found by Simon Horman during review for v1 patch.
v1: https://lore.kernel.org/20250613055700.415596-1-kuni1840@gmail.com
====================
Link: https://patch.msgid.link/20250616182147.963333-1-kuni1840@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atmdev.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 9b02961d65ee..45f2f278b50a 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -249,6 +249,12 @@ static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb) ATM_SKB(skb)->atm_options = vcc->atm_options; } +static inline void atm_return_tx(struct atm_vcc *vcc, struct sk_buff *skb) +{ + WARN_ON_ONCE(refcount_sub_and_test(ATM_SKB(skb)->acct_truesize, + &sk_atm(vcc)->sk_wmem_alloc)); +} + static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) { atomic_add(truesize, &sk_atm(vcc)->sk_rmem_alloc); |
