Skip to content

Commit

Permalink
[CCID]: Make ccid_hc_[rt]x_exit accept NULL arguments
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Arnaldo Carvalho de Melo authored and David S. Miller committed Aug 29, 2005
1 parent a4beb1b commit 012e13e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/dccp/ccid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 012e13e

Please sign in to comment.