diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-14 11:00:38 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-14 11:00:38 +0300 |
commit | e6cb9c167eeb8f90ab924666c573e69e85e700a0 (patch) | |
tree | 7ea46d78b06ce1ebdc05ea92faad03281b8162d1 /include/net/ax25.h | |
parent | 0580565dd717cb135633ebdbc1d84fe6b0a3fa78 (diff) | |
parent | 754e0b0e35608ed5206d6a67a791563c631cec07 (diff) | |
download | linux-e6cb9c167eeb8f90ab924666c573e69e85e700a0.tar.xz |
Merge 5.17-rc4 into char-misc-next
We need the char/misc fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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 526e49589197..8221af1811df 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -239,6 +239,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 { @@ -293,6 +294,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; |