summaryrefslogtreecommitdiff
path: root/net/caif/cfmuxl.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-05-10 20:39:28 +0400
committerPatrick McHardy <kaber@trash.net>2010-05-10 20:39:28 +0400
commit1e4b1057121bc756b91758a434b504d2010f6088 (patch)
treeb016cf2c728289c7e36d9e4e488f30ab0bd0ae6e /net/caif/cfmuxl.c
parent3b254c54ec46eb022cb26ee6ab37fae23f5f7d6a (diff)
parent3ee943728fff536edaf8f59faa58aaa1aa7366e3 (diff)
downloadlinux-1e4b1057121bc756b91758a434b504d2010f6088.tar.xz
Merge branch 'master' of /repos/git/net-next-2.6
Conflicts: net/bridge/br_device.c net/bridge/br_forward.c Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/caif/cfmuxl.c')
-rw-r--r--net/caif/cfmuxl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/caif/cfmuxl.c b/net/caif/cfmuxl.c
index 6fb9f9e96cf8..7372f27f1d32 100644
--- a/net/caif/cfmuxl.c
+++ b/net/caif/cfmuxl.c
@@ -62,6 +62,7 @@ int cfmuxl_set_uplayer(struct cflayer *layr, struct cflayer *up, u8 linkid)
{
struct cfmuxl *muxl = container_obj(layr);
spin_lock(&muxl->receive_lock);
+ cfsrvl_get(up);
list_add(&up->node, &muxl->srvl_list);
spin_unlock(&muxl->receive_lock);
return 0;
@@ -172,8 +173,11 @@ struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 id)
struct cfmuxl *muxl = container_obj(layr);
spin_lock(&muxl->receive_lock);
up = get_up(muxl, id);
+ if (up == NULL)
+ return NULL;
memset(muxl->up_cache, 0, sizeof(muxl->up_cache));
list_del(&up->node);
+ cfsrvl_put(up);
spin_unlock(&muxl->receive_lock);
return up;
}
@@ -203,8 +207,9 @@ static int cfmuxl_receive(struct cflayer *layr, struct cfpkt *pkt)
*/
return /* CFGLU_EPROT; */ 0;
}
-
+ cfsrvl_get(up);
ret = up->receive(up, pkt);
+ cfsrvl_put(up);
return ret;
}