History

net: usbnet: fix SG initialisation

Commit 60e453a940ac ("USBNET: fix handling padding packet") added an extra SG entry in case padding is necessary, but failed to update the initialisation of the list. This can cause list traversal to fall off the end of the list, resulting in an oops.

Bjørn Mork committed 12 years ago

Commit fdc34521 parent 70315d21 file · +1 −1Browse files

Unified · Split

drivers/net/usb/usbnet.c+1−1
@@ -1245,7 +1245,7 @@ static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) · 1244 unmodified lines
1245 return -ENOMEM;1245 return -ENOMEM;
1246 1246
1247 urb->num_sgs = num_sgs;1247 urb->num_sgs = num_sgs;
1248 sg_init_table(urb->sg, urb->num_sgs);1248 sg_init_table(urb->sg, urb->num_sgs + 1);
1249 1249
1250 sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb));1250 sg_set_buf(&urb->sg[s++], skb->data, skb_headlen(skb));
1251 total_len += skb_headlen(skb);1251 total_len += skb_headlen(skb);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t