diff options
Diffstat (limited to 'net/caif/cfmuxl.c')
-rw-r--r-- | net/caif/cfmuxl.c | 7 |
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) | |||
62 | { | 62 | { |
63 | struct cfmuxl *muxl = container_obj(layr); | 63 | struct cfmuxl *muxl = container_obj(layr); |
64 | spin_lock(&muxl->receive_lock); | 64 | spin_lock(&muxl->receive_lock); |
65 | cfsrvl_get(up); | ||
65 | list_add(&up->node, &muxl->srvl_list); | 66 | list_add(&up->node, &muxl->srvl_list); |
66 | spin_unlock(&muxl->receive_lock); | 67 | spin_unlock(&muxl->receive_lock); |
67 | return 0; | 68 | return 0; |
@@ -172,8 +173,11 @@ struct cflayer *cfmuxl_remove_uplayer(struct cflayer *layr, u8 id) | |||
172 | struct cfmuxl *muxl = container_obj(layr); | 173 | struct cfmuxl *muxl = container_obj(layr); |
173 | spin_lock(&muxl->receive_lock); | 174 | spin_lock(&muxl->receive_lock); |
174 | up = get_up(muxl, id); | 175 | up = get_up(muxl, id); |
176 | if (up == NULL) | ||
177 | return NULL; | ||
175 | memset(muxl->up_cache, 0, sizeof(muxl->up_cache)); | 178 | memset(muxl->up_cache, 0, sizeof(muxl->up_cache)); |
176 | list_del(&up->node); | 179 | list_del(&up->node); |
180 | cfsrvl_put(up); | ||
177 | spin_unlock(&muxl->receive_lock); | 181 | spin_unlock(&muxl->receive_lock); |
178 | return up; | 182 | return up; |
179 | } | 183 | } |
@@ -203,8 +207,9 @@ static int cfmuxl_receive(struct cflayer *layr, struct cfpkt *pkt) | |||
203 | */ | 207 | */ |
204 | return /* CFGLU_EPROT; */ 0; | 208 | return /* CFGLU_EPROT; */ 0; |
205 | } | 209 | } |
206 | 210 | cfsrvl_get(up); | |
207 | ret = up->receive(up, pkt); | 211 | ret = up->receive(up, pkt); |
212 | cfsrvl_put(up); | ||
208 | return ret; | 213 | return ret; |
209 | } | 214 | } |
210 | 215 | ||