diff options
author | Tony Lindgren <tony@atomide.com> | 2012-02-24 19:48:27 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-02-24 19:48:27 -0500 |
commit | ffd76d8be36da09f8456c55569c008f5aa93095e (patch) | |
tree | 4a5e537edcdd3be9197c5fb7af1b4f7e4780ef77 /net/caif | |
parent | bfe9c8ae114009491f51452ec727667d516ee79f (diff) | |
parent | f0e15e2b0c6b3e89daade25a1e9a2d80136c14c3 (diff) |
Merge branch 'for_3.4/dts_updates' of git://git.kernel.org/pub/scm/linux/kernel/git/bcousson/linux-omap-dt into dt
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/caif_socket.c | 10 | ||||
-rw-r--r-- | net/caif/cfmuxl.c | 12 |
2 files changed, 9 insertions, 13 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index a98628086452..a97d97a3a512 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -539,8 +539,10 @@ static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk, | |||
539 | pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); | 539 | pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); |
540 | memset(skb->cb, 0, sizeof(struct caif_payload_info)); | 540 | memset(skb->cb, 0, sizeof(struct caif_payload_info)); |
541 | 541 | ||
542 | if (cf_sk->layer.dn == NULL) | 542 | if (cf_sk->layer.dn == NULL) { |
543 | kfree_skb(skb); | ||
543 | return -EINVAL; | 544 | return -EINVAL; |
545 | } | ||
544 | 546 | ||
545 | return cf_sk->layer.dn->transmit(cf_sk->layer.dn, pkt); | 547 | return cf_sk->layer.dn->transmit(cf_sk->layer.dn, pkt); |
546 | } | 548 | } |
@@ -683,10 +685,10 @@ static int caif_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, | |||
683 | } | 685 | } |
684 | err = transmit_skb(skb, cf_sk, | 686 | err = transmit_skb(skb, cf_sk, |
685 | msg->msg_flags&MSG_DONTWAIT, timeo); | 687 | msg->msg_flags&MSG_DONTWAIT, timeo); |
686 | if (err < 0) { | 688 | if (err < 0) |
687 | kfree_skb(skb); | 689 | /* skb is already freed */ |
688 | goto pipe_err; | 690 | goto pipe_err; |
689 | } | 691 | |
690 | sent += size; | 692 | sent += size; |
691 | } | 693 | } |
692 | 694 | ||
diff --git a/net/caif/cfmuxl.c b/net/caif/cfmuxl.c index b36f24a4c8e7..94b08612a4d8 100644 --- a/net/caif/cfmuxl.c +++ b/net/caif/cfmuxl.c | |||
@@ -248,7 +248,6 @@ static void cfmuxl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | |||
248 | { | 248 | { |
249 | struct cfmuxl *muxl = container_obj(layr); | 249 | struct cfmuxl *muxl = container_obj(layr); |
250 | struct cflayer *layer; | 250 | struct cflayer *layer; |
251 | int idx; | ||
252 | 251 | ||
253 | rcu_read_lock(); | 252 | rcu_read_lock(); |
254 | list_for_each_entry_rcu(layer, &muxl->srvl_list, node) { | 253 | list_for_each_entry_rcu(layer, &muxl->srvl_list, node) { |
@@ -257,14 +256,9 @@ static void cfmuxl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, | |||
257 | 256 | ||
258 | if ((ctrl == _CAIF_CTRLCMD_PHYIF_DOWN_IND || | 257 | if ((ctrl == _CAIF_CTRLCMD_PHYIF_DOWN_IND || |
259 | ctrl == CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND) && | 258 | ctrl == CAIF_CTRLCMD_REMOTE_SHUTDOWN_IND) && |
260 | layer->id != 0) { | 259 | layer->id != 0) |
261 | 260 | cfmuxl_remove_uplayer(layr, layer->id); | |
262 | idx = layer->id % UP_CACHE_SIZE; | 261 | |
263 | spin_lock_bh(&muxl->receive_lock); | ||
264 | RCU_INIT_POINTER(muxl->up_cache[idx], NULL); | ||
265 | list_del_rcu(&layer->node); | ||
266 | spin_unlock_bh(&muxl->receive_lock); | ||
267 | } | ||
268 | /* NOTE: ctrlcmd is not allowed to block */ | 262 | /* NOTE: ctrlcmd is not allowed to block */ |
269 | layer->ctrlcmd(layer, ctrl, phyid); | 263 | layer->ctrlcmd(layer, ctrl, phyid); |
270 | } | 264 | } |