re: xen-blkback: move free persistent grants code

Dan Carpenter
2012-12-03T21:11:48Z

Hello Roger Pau Monne,

The patch 4d4f270f1880: "xen-blkback: move free persistent grants
code" from Nov 16, 2012, leads to the following warning:
drivers/block/xen-blkback/blkback.c:238 free_persistent_gnts()
warn: 'persistent_gnt' was already freed.

drivers/block/xen-blkback/blkback.c
232 pages[segs_to_unmap] = persistent_gnt->page;
233 rb_erase(&persistent_gnt->node, root);
234 kfree(persistent_gnt);
^^^^^^^^^^^^^^^^^^^^
kfree();

235 num--;
236
237 if (++segs_to_unmap == BLKIF_MAX_SEGMENTS_PER_REQUEST ||
238 !rb_next(&persistent_gnt->node)) {
^^^^^^^^^^^^^^^^^^^^^
Dereferenced inside the call to rb_next().

239 ret = gnttab_unmap_refs(unmap, NULL, pages,
240 segs_to_unmap);

regards,
dan carpenter