Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96225
b: refs/heads/master
c: c2ab7ac
h: refs/heads/master
i:
  96223: d75fa7c
v: v3
  • Loading branch information
Oliver Hartkopp authored and David S. Miller committed May 8, 2008
1 parent c49d1b6 commit 86015ff
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 33f9936b2b73dba6c8685994c441c4fd30b04814
refs/heads/master: c2ab7ac225e29006b7117d6a9fe8f3be8d98b0c2
16 changes: 12 additions & 4 deletions trunk/net/can/af_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
*/
int can_send(struct sk_buff *skb, int loop)
{
struct sk_buff *newskb = NULL;
int err;

if (skb->dev->type != ARPHRD_CAN) {
Expand Down Expand Up @@ -244,8 +245,7 @@ int can_send(struct sk_buff *skb, int loop)
* If the interface is not capable to do loopback
* itself, we do it here.
*/
struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);

newskb = skb_clone(skb, GFP_ATOMIC);
if (!newskb) {
kfree_skb(skb);
return -ENOMEM;
Expand All @@ -254,7 +254,6 @@ int can_send(struct sk_buff *skb, int loop)
newskb->sk = skb->sk;
newskb->ip_summed = CHECKSUM_UNNECESSARY;
newskb->pkt_type = PACKET_BROADCAST;
netif_rx(newskb);
}
} else {
/* indication for the CAN driver: no loopback required */
Expand All @@ -266,11 +265,20 @@ int can_send(struct sk_buff *skb, int loop)
if (err > 0)
err = net_xmit_errno(err);

if (err) {
if (newskb)
kfree_skb(newskb);
return err;
}

if (newskb)
netif_rx(newskb);

/* update statistics */
can_stats.tx_frames++;
can_stats.tx_frames_delta++;

return err;
return 0;
}
EXPORT_SYMBOL(can_send);

Expand Down

0 comments on commit 86015ff

Please sign in to comment.