[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201006041028.56798.rusty@rustcorp.com.au>
Date: Fri, 4 Jun 2010 10:28:56 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: stable@...nel.org
Cc: Bruce Rogers <brogers@...ell.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
netdev@...r.kernel.org
Subject: [PATCH] virtio_net: indicate oom when addbuf returns failure
This patch is a subset of an already upstream patch, but this portion
is useful in earlier releases.
Please consider for the 2.6.32 and 2.6.33 stable trees.
If the add_buf operation fails, indicate failure to the caller.
Signed-off-by: Bruce Rogers <brogers@...ell.com>
Signed-off-by: Rusty Russell <rusty@...tcorp.com.au>
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -318,6 +318,7 @@ static bool try_fill_recv_maxbufs(struct
skb_unlink(skb, &vi->recv);
trim_pages(vi, skb);
kfree_skb(skb);
+ oom = true;
break;
}
vi->num++;
@@ -368,6 +369,7 @@ static bool try_fill_recv(struct virtnet
if (err < 0) {
skb_unlink(skb, &vi->recv);
kfree_skb(skb);
+ oom = true;
break;
}
vi->num++;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists