From: Arnaldo Carvalho de Melo Date: Wed, 24 Aug 2005 04:51:13 +0000 (-0700) Subject: [CCID]: Make ccid_hc_[rt]x_exit accept NULL arguments X-Git-Tag: v2.6.14-rc1~1035^2~38 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=012e13eac7579fcc7618df4ca1d5af3cdc03748c;p=linux-2.6 [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 Signed-off-by: David S. Miller --- diff --git a/net/dccp/ccid.h b/net/dccp/ccid.h index 95eb47d855..c6767b2822 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) static inline void ccid_hc_rx_exit(struct ccid *ccid, struct sock *sk) { - if (ccid->ccid_hc_rx_exit != NULL) + if (ccid->ccid_hc_rx_exit != NULL && + dccp_sk(sk)->dccps_hc_rx_ccid_private != NULL) ccid->ccid_hc_rx_exit(sk); } static inline void ccid_hc_tx_exit(struct ccid *ccid, struct sock *sk) { - if (ccid->ccid_hc_tx_exit != NULL) + if (ccid->ccid_hc_tx_exit != NULL && + dccp_sk(sk)->dccps_hc_tx_ccid_private != NULL) ccid->ccid_hc_tx_exit(sk); }