[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>
This commit is contained in:
Arnaldo Carvalho de Melo
2006-03-20 17:20:23 -08:00
committed by David S. Miller
parent 02bcf28c82
commit 411447019a
2 changed files with 1 additions and 15 deletions

View File

@@ -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();