Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210149
b: refs/heads/master
c: 1bf145f
h: refs/heads/master
i:
  210147: a157d2d
v: v3
  • Loading branch information
Stefan Richter committed Aug 19, 2010
1 parent 5b5221e commit 0f0afc4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 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: a481e97d3cdc40b9d58271675bd4f0abb79d4872
refs/heads/master: 1bf145fed572583d4cb7c1784689a0b42c997ba6
28 changes: 15 additions & 13 deletions trunk/drivers/firewire/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
if (!peer) {
fw_notify("No peer for ARP packet from %016llx\n",
(unsigned long long)peer_guid);
goto failed_proto;
goto no_peer;
}

/*
Expand Down Expand Up @@ -656,15 +656,15 @@ static int fwnet_finish_incoming_packet(struct net_device *net,

return 0;

failed_proto:
no_peer:
net->stats.rx_errors++;
net->stats.rx_dropped++;

dev_kfree_skb_any(skb);
if (netif_queue_stopped(net))
netif_wake_queue(net);

return 0;
return -ENOENT;
}

static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
Expand Down Expand Up @@ -701,7 +701,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
fw_error("out of memory\n");
net->stats.rx_dropped++;

return -1;
return -ENOMEM;
}
skb_reserve(skb, (net->hard_header_len + 15) & ~15);
memcpy(skb_put(skb, len), buf, len);
Expand All @@ -726,8 +726,10 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
spin_lock_irqsave(&dev->lock, flags);

peer = fwnet_peer_find_by_node_id(dev, source_node_id, generation);
if (!peer)
goto bad_proto;
if (!peer) {
retval = -ENOENT;
goto fail;
}

pd = fwnet_pd_find(peer, datagram_label);
if (pd == NULL) {
Expand All @@ -741,7 +743,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
dg_size, buf, fg_off, len);
if (pd == NULL) {
retval = -ENOMEM;
goto bad_proto;
goto fail;
}
peer->pdg_size++;
} else {
Expand All @@ -755,9 +757,9 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
pd = fwnet_pd_new(net, peer, datagram_label,
dg_size, buf, fg_off, len);
if (pd == NULL) {
retval = -ENOMEM;
peer->pdg_size--;
goto bad_proto;
retval = -ENOMEM;
goto fail;
}
} else {
if (!fwnet_pd_update(peer, pd, buf, fg_off, len)) {
Expand All @@ -768,7 +770,8 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
*/
fwnet_pd_delete(pd);
peer->pdg_size--;
goto bad_proto;
retval = -ENOMEM;
goto fail;
}
}
} /* new datagram or add to existing one */
Expand All @@ -794,14 +797,13 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len,
spin_unlock_irqrestore(&dev->lock, flags);

return 0;

bad_proto:
fail:
spin_unlock_irqrestore(&dev->lock, flags);

if (netif_queue_stopped(net))
netif_wake_queue(net);

return 0;
return retval;
}

static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
Expand Down

0 comments on commit 0f0afc4

Please sign in to comment.