diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2022-02-03 17:36:16 -0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2022-02-03 17:36:16 -0800 |
| commit | c59400a68c53374179cdc5f99fa77afbd092dcf8 (patch) | |
| tree | c5e17286fa5b7867a5290a975cca3bc5759d510e /include/net/ax25.h | |
| parent | Merge branch 'dsa-mv88e6xxx-phylink_generic_validate' (diff) | |
| parent | gcc-plugins/stackleak: Use noinstr in favor of notrace (diff) | |
| download | linux-c59400a68c53374179cdc5f99fa77afbd092dcf8.tar.gz linux-c59400a68c53374179cdc5f99fa77afbd092dcf8.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
No conflicts.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/ax25.h')
| -rw-r--r-- | include/net/ax25.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h index cb628c5d7c5b..0f9790c455bb 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -227,6 +227,7 @@ typedef struct ax25_dev { #if defined(CONFIG_AX25_DAMA_SLAVE) || defined(CONFIG_AX25_DAMA_MASTER) ax25_dama_info dama; #endif + refcount_t refcount; } ax25_dev; typedef struct ax25_cb { @@ -281,6 +282,17 @@ static __inline__ void ax25_cb_put(ax25_cb *ax25) } } +static inline void ax25_dev_hold(ax25_dev *ax25_dev) +{ + refcount_inc(&ax25_dev->refcount); +} + +static inline void ax25_dev_put(ax25_dev *ax25_dev) +{ + if (refcount_dec_and_test(&ax25_dev->refcount)) { + kfree(ax25_dev); + } +} static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev) { skb->dev = dev; |
