macvtap: fix recovery from gup errors
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 23 Jun 2013 14:26:58 +0000 (17:26 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jul 2013 23:25:56 +0000 (16:25 -0700)
commit2b01eeeaa363dc4cd5e6d9efd962ac55cc3d5d48
treeecf80cffe34acd5c73e4a1a1927b5f5cc41a72a1
parentdabed30c3f3af3afd343ad33e3fa0b741ffdebb3
macvtap: fix recovery from gup errors

[ Upstream commit 4c7ab054ab4f5d63625508ed6f8a607184cae7c2 ]

get user pages might fail partially in macvtap zero copy
mode. To recover we need to put all pages that we got,
but code used a wrong index resulting in double-free
errors.

Reported-by: Brad Hubbard <bhubbard@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/macvtap.c