aboutsummaryrefslogtreecommitdiffstats
path: root/net/caif/caif_socket.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-02-04 16:39:32 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-04 16:39:32 -0500
commitdd48dc34fe7639a8b2e22d8b609672f5f81aa7cb (patch)
treef16ace0ae09edab16bf6d0be9e8280dfbb7100da /net/caif/caif_socket.c
parent8d9eb069eafce49307f839783e4a4673414b1fd5 (diff)
parent5962b35c1de3254a2f03b95efd3b7854b874d7b7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/caif/caif_socket.c')
-rw-r--r--net/caif/caif_socket.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index 0d1131864630..5016fa57b623 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -506,8 +506,10 @@ static int transmit_skb(struct sk_buff *skb, struct caifsock *cf_sk,
506 pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); 506 pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb);
507 memset(skb->cb, 0, sizeof(struct caif_payload_info)); 507 memset(skb->cb, 0, sizeof(struct caif_payload_info));
508 508
509 if (cf_sk->layer.dn == NULL) 509 if (cf_sk->layer.dn == NULL) {
510 kfree_skb(skb);
510 return -EINVAL; 511 return -EINVAL;
512 }
511 513
512 return cf_sk->layer.dn->transmit(cf_sk->layer.dn, pkt); 514 return cf_sk->layer.dn->transmit(cf_sk->layer.dn, pkt);
513} 515}
@@ -650,10 +652,10 @@ static int caif_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
650 } 652 }
651 err = transmit_skb(skb, cf_sk, 653 err = transmit_skb(skb, cf_sk,
652 msg->msg_flags&MSG_DONTWAIT, timeo); 654 msg->msg_flags&MSG_DONTWAIT, timeo);
653 if (err < 0) { 655 if (err < 0)
654 kfree_skb(skb); 656 /* skb is already freed */
655 goto pipe_err; 657 goto pipe_err;
656 } 658
657 sent += size; 659 sent += size;
658 } 660 }
659 661