Skip to content

Commit

Permalink
[PATCH] orinoco: remove redundance skb length check before padding
Browse files Browse the repository at this point in the history
Checking the skb->len value before calling skb_padto is redundant.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
John W. Linville authored and Jeff Garzik committed Oct 19, 2005
1 parent 9f38c63 commit 36841c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,11 +492,9 @@ static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)

/* Check packet length, pad short packets, round up odd length */
len = max_t(int, ALIGN(skb->len, 2), ETH_ZLEN);
if (skb->len < len) {
skb = skb_padto(skb, len);
if (skb == NULL)
goto fail;
}
skb = skb_padto(skb, len);
if (skb == NULL)
goto fail;
len -= ETH_HLEN;

eh = (struct ethhdr *)skb->data;
Expand Down

0 comments on commit 36841c9

Please sign in to comment.