Colin Ian King f0fba398fe block: avoid null pointer dereference on null disk
It is possible that the pointer disk can be null and hence
we can get a null pointer deference when accessing disk->flags.
Add a null pointer check to avoid the dereference.

Detected by CoverityScan, CID#1461133 ("Explicit null dereferenced")

Fixes: 8ddcd653257c ("block: introduce GENHD_FL_HIDDEN")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-11-10 19:55:57 -07:00
..
2017-10-16 13:00:12 -06:00
2017-10-01 01:26:21 -06:00
2017-11-10 19:53:25 -07:00
2017-10-10 13:48:14 -06:00
2017-04-21 07:56:23 -06:00
2017-08-18 08:36:58 -06:00
2017-10-25 12:36:50 -06:00