Nivedita Singhvi
2005-Jun-01 23:11 UTC
[Xen-devel] Resend: [PATCH] skb_copy_bits() can return err]
[Resend with patch included inline and signed-off by; sorry] skb_copy_bits() can return an err, so have netif_be_start_xmit() crash informatively.. thanks, Nivedita Signed-off-by: Nivedita Singhvi (niv@us.ibm.com) --- diff -urN xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c --- xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 2005-05-31 20:12:37.000000000 -0700 +++ niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 2005-06-01 15:20:52.954245318 -0700 @@ -153,7 +153,9 @@ goto drop; skb_reserve(nskb, hlen); __skb_put(nskb, skb->len); - (void)skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen); + if (skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen)) { + BUG(); + } nskb->dev = skb->dev; nskb->proto_csum_valid = skb->proto_csum_valid; dev_kfree_skb(skb); _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Adam Heath
2005-Jun-01 23:17 UTC
Re: [Xen-devel] Resend: [PATCH] skb_copy_bits() can return err]
On Wed, 1 Jun 2005, Nivedita Singhvi wrote:> [Resend with patch included inline and signed-off by; sorry] > > skb_copy_bits() can return an err, so have netif_be_start_xmit() > crash informatively.. > > thanks, > Nivedita > > Signed-off-by: Nivedita Singhvi (niv@us.ibm.com) > --- > diff -urN xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c > --- xen-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 2005-05-31 20:12:37.000000000 -0700 > +++ niv-unstable-0601/linux-2.6.11-xen-sparse/drivers/xen/netback/netback.c 2005-06-01 15:20:52.954245318 -0700 > @@ -153,7 +153,9 @@ > goto drop; > skb_reserve(nskb, hlen); > __skb_put(nskb, skb->len); > - (void)skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen); > + if (skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen)) { > + BUG(); > + } > nskb->dev = skb->dev; > nskb->proto_csum_valid = skb->proto_csum_valid; > dev_kfree_skb(skb);Spacing problems. Please check Documentation/CodingStyle. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel