diff --git a/lib/label/label.c b/lib/label/label.c index c92d2cf8d..ca8502d41 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -1341,7 +1341,11 @@ void dev_set_last_byte(struct device *dev, uint64_t offset) unsigned int phys_block_size = 0; unsigned int block_size = 0; - dev_get_block_size(dev, &phys_block_size, &block_size); + if (!dev_get_block_size(dev, &phys_block_size, &block_size)) { + stack; + /* FIXME ASSERT or regular error testing is missing */ + return; + } bcache_set_last_byte(scan_bcache, dev->bcache_fd, offset, phys_block_size); }