diff options
author | David S. Miller <davem@davemloft.net> | 2012-02-04 22:39:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-04 22:39:32 +0100 |
commit | dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb (patch) | |
tree | f16ace0ae09edab16bf6d0be9e8280dfbb7100da /net/caif/caif_socket.c | |
parent | mlx4: Fix typo in cmd.c (diff) | |
parent | netprio_cgroup: Fix obo in get_prioidx (diff) | |
download | linux-dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb.tar.xz linux-dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb.zip |
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.c | 10 |
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, pkt = cfpkt_fromnative(CAIF_DIR_OUT, skb); memset(skb->cb, 0, sizeof(struct caif_payload_info)); - if (cf_sk->layer.dn == NULL) + if (cf_sk->layer.dn == NULL) { + kfree_skb(skb); return -EINVAL; + } return cf_sk->layer.dn->transmit(cf_sk->layer.dn, pkt); } @@ -650,10 +652,10 @@ static int caif_stream_sendmsg(struct kiocb *kiocb, struct socket *sock, } err = transmit_skb(skb, cf_sk, msg->msg_flags&MSG_DONTWAIT, timeo); - if (err < 0) { - kfree_skb(skb); + if (err < 0) + /* skb is already freed */ goto pipe_err; - } + sent += size; } |