summaryrefslogtreecommitdiff
path: root/net/dccp/ccid.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-03-20 17:20:23 -0800
committerDavid S. Miller <davem@davemloft.net>2006-03-20 17:20:23 -0800
commit411447019ab583c659600b0519db5658a2444f11 (patch)
tree3bf3e7c655c91097cead92c65334a4ebbb51906e /net/dccp/ccid.c
parent02bcf28c82c8e4b72c4b89bddbbb6fea1a646d07 (diff)
[DCCP] CCID: Allow ccid_{init,exit} to be NULL
Testing if the ccid being instantiated has these methods in ccid_init(). Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccid.c')
-rw-r--r--net/dccp/ccid.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c
index 9d8fc0e289ea..06b191a5740b 100644
--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -59,9 +59,6 @@ int ccid_register(struct ccid *ccid)
{
int err;
- if (ccid->ccid_init == NULL)
- return -1;
-
ccids_write_lock();
err = -EEXIST;
if (ccids[ccid->ccid_id] == NULL) {
@@ -106,7 +103,7 @@ struct ccid *ccid_init(unsigned char id, struct sock *sk)
if (!try_module_get(ccid->ccid_owner))
goto out_err;
- if (ccid->ccid_init(sk) != 0)
+ if (ccid->ccid_init != NULL && ccid->ccid_init(sk) != 0)
goto out_module_put;
out:
ccids_read_unlock();