Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36414
b: refs/heads/master
c: 9bcbcf4
h: refs/heads/master
v: v3
  • Loading branch information
dave rientjes authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent b3e9b22 commit 39c99f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 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: 5482687b8be4dedb8a5879f07c734ff11a88a7d5
refs/heads/master: 9bcbcf4d00cd2400e655a738e77f0d21b69c6771
15 changes: 7 additions & 8 deletions trunk/drivers/usb/net/net1080.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,25 +498,24 @@ static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
static struct sk_buff *
net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
{
int padlen;
struct sk_buff *skb2;
struct nc_header *header = NULL;
struct nc_trailer *trailer = NULL;
int padlen = sizeof (struct nc_trailer);
int len = skb->len;

padlen = ((len + sizeof (struct nc_header)
+ sizeof (struct nc_trailer)) & 0x01) ? 0 : 1;
if (!((len + padlen + sizeof (struct nc_header)) & 0x01))
padlen++;
if (!skb_cloned(skb)) {
int headroom = skb_headroom(skb);
int tailroom = skb_tailroom(skb);

if ((padlen + sizeof (struct nc_trailer)) <= tailroom
&& sizeof (struct nc_header) <= headroom)
if (padlen <= tailroom &&
sizeof(struct nc_header) <= headroom)
/* There's enough head and tail room */
goto encapsulate;

if ((sizeof (struct nc_header) + padlen
+ sizeof (struct nc_trailer)) <
if ((sizeof (struct nc_header) + padlen) <
(headroom + tailroom)) {
/* There's enough total room, so just readjust */
skb->data = memmove(skb->head
Expand All @@ -530,7 +529,7 @@ net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
/* Create a new skb to use with the correct size */
skb2 = skb_copy_expand(skb,
sizeof (struct nc_header),
sizeof (struct nc_trailer) + padlen,
padlen,
flags);
dev_kfree_skb_any(skb);
if (!skb2)
Expand Down

0 comments on commit 39c99f5

Please sign in to comment.