diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-08-24 00:51:13 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 19:04:48 -0400 |
commit | 012e13eac7579fcc7618df4ca1d5af3cdc03748c (patch) | |
tree | 934c71228174d0da4a324afc1b7b001db9978911 | |
parent | a4beb1b64f5846e216bf2c439022df480151902a (diff) |
[CCID]: Make ccid_hc_[rt]x_exit accept NULL arguments
Just like kfree, etc it will just not call the CCID exit
routines when the private data area is set to NULL.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/dccp/ccid.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h index 95eb47d85517..c6767b282244 100644 --- a/net/dccp/ccid.h +++ b/net/dccp/ccid.h | |||
@@ -97,13 +97,15 @@ static inline int ccid_hc_tx_init(struct ccid *ccid, struct sock *sk) | |||
97 | 97 | ||
98 | static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk) | 98 | static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk) |
99 | { | 99 | { |
100 | if (ccid->ccid_hc_rx_exit != NULL) | 100 | if (ccid->ccid_hc_rx_exit != NULL && |
101 | dccp_sk(sk)->dccps_hc_rx_ccid_private != NULL) | ||
101 | ccid->ccid_hc_rx_exit(sk); | 102 | ccid->ccid_hc_rx_exit(sk); |
102 | } | 103 | } |
103 | 104 | ||
104 | static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk) | 105 | static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk) |
105 | { | 106 | { |
106 | if (ccid->ccid_hc_tx_exit != NULL) | 107 | if (ccid->ccid_hc_tx_exit != NULL && |
108 | dccp_sk(sk)->dccps_hc_tx_ccid_private != NULL) | ||
107 | ccid->ccid_hc_tx_exit(sk); | 109 | ccid->ccid_hc_tx_exit(sk); |
108 | } | 110 | } |
109 | 111 | ||