block: Fix anonymous BBs in blk_root_inactivate()
authorKevin Wolf <kwolf@redhat.com>
Mon, 22 May 2017 15:03:39 +0000 (17:03 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 9 Jun 2017 09:45:03 +0000 (11:45 +0200)
commit93c26503e01808bfb8cea3c25eae5be63147380e
treedb81e67a1eef8fb9dab31577dd83d62815e60c7a
parent64175afc695c0672876fbbfc31b299c86d562cb4
block: Fix anonymous BBs in blk_root_inactivate()

blk->name isn't an array, but a pointer that can be NULL. Checking for
an anonymous BB must involve a NULL check first, otherwise we get
crashes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
block/block-backend.c