Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287482
b: refs/heads/master
c: ba76057
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Tarnyagin authored and David S. Miller committed Feb 2, 2012
1 parent b23d2e9 commit 573a791
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b01377a4200d0dfc7b04a8daabb4739727353703
refs/heads/master: ba7605745d5c99f0e71b3ec6c7cb5ed6afe540ad
10 changes: 6 additions & 4 deletions trunk/net/caif/caif_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,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);
}
Expand Down Expand Up @@ -683,10 +685,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;
}

Expand Down

0 comments on commit 573a791

Please sign in to comment.