diff options
Diffstat (limited to 'drivers/block/xen-blkback/blkback.c')
-rw-r--r-- | drivers/block/xen-blkback/blkback.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index c73910cc28c9..5cf2993a8338 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c | |||
@@ -809,11 +809,13 @@ static int __init xen_blkif_init(void) | |||
809 | failed_init: | 809 | failed_init: |
810 | kfree(blkbk->pending_reqs); | 810 | kfree(blkbk->pending_reqs); |
811 | kfree(blkbk->pending_grant_handles); | 811 | kfree(blkbk->pending_grant_handles); |
812 | for (i = 0; i < mmap_pages; i++) { | 812 | if (blkbk->pending_pages) { |
813 | if (blkbk->pending_pages[i]) | 813 | for (i = 0; i < mmap_pages; i++) { |
814 | __free_page(blkbk->pending_pages[i]); | 814 | if (blkbk->pending_pages[i]) |
815 | __free_page(blkbk->pending_pages[i]); | ||
816 | } | ||
817 | kfree(blkbk->pending_pages); | ||
815 | } | 818 | } |
816 | kfree(blkbk->pending_pages); | ||
817 | kfree(blkbk); | 819 | kfree(blkbk); |
818 | blkbk = NULL; | 820 | blkbk = NULL; |
819 | return rc; | 821 | return rc; |