vhost: fix ubuf_info cleanup
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 6 Jun 2013 12:20:46 +0000 (15:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 11 Jun 2013 09:46:21 +0000 (02:46 -0700)
commit288cfe78c8173f35c7a94f06859f60b3693d828a
treef84bd0f51046e6372ca390ba3302ae60c3a6bc28
parent05c05351943cc03bf5c77e86953b24ae6fb21368
vhost: fix ubuf_info cleanup

vhost_net_clear_ubuf_info didn't clear ubuf_info
after kfree, this could trigger double free.
Fix this and simplify this code to make it more robust: make sure
ubuf info is always freed through vhost_net_clear_ubuf_info.

Reported-by: Tommi Rantala <tt.rantala@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c