o llc: remove MOD_{INC,DEC}_USE_COUNT

Now the core networking infrastructure will (finally) do that for the net
protocol families, its just a matter of setting the ->owner field in the
registered struct net_proto_family to THIS_MODULE.
parent b1ee64fe
......@@ -43,16 +43,15 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
/* verify this SAP is not already open; if so, return error */
struct llc_sap *sap;
MOD_INC_USE_COUNT;
sap = llc_sap_find(lsap);
if (sap) { /* SAP already exists */
sap = NULL;
goto err;
goto out;
}
/* sap requested does not yet exist */
sap = llc_sap_alloc();
if (!sap)
goto err;
goto out;
/* allocated a SAP; initialize it and clear out its memory pool */
sap->laddr.lsap = lsap;
sap->rcv_func = func;
......@@ -61,9 +60,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
llc_sap_save(sap);
out:
return sap;
err:
MOD_DEC_USE_COUNT;
goto out;
}
/**
......@@ -76,7 +72,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
void llc_sap_close(struct llc_sap *sap)
{
llc_free_sap(sap);
MOD_DEC_USE_COUNT;
}
/**
......
......@@ -224,9 +224,8 @@ struct sock *llc_sk_alloc(int family, int priority)
{
struct sock *sk = sk_alloc(family, priority, 1, NULL);
MOD_INC_USE_COUNT;
if (!sk)
goto decmod;
goto out;
if (llc_sk_init(sk))
goto outsk;
sock_init_data(NULL, sk);
......@@ -240,8 +239,6 @@ struct sock *llc_sk_alloc(int family, int priority)
outsk:
sk_free(sk);
sk = NULL;
decmod:
MOD_DEC_USE_COUNT;
goto out;
}
......@@ -279,7 +276,6 @@ void llc_sk_free(struct sock *sk)
}
#endif
sock_put(sk);
MOD_DEC_USE_COUNT;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment