]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/blkdev: get_device_by_uuid() silence clang warning
authorKefu Chai <kchai@redhat.com>
Wed, 23 Nov 2016 05:31:28 +0000 (13:31 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 23 Nov 2016 06:52:18 +0000 (14:52 +0800)
early return if blkid_get_cache() fails. this chance is but cosmetic,
it pleases clang static analyzer which thinks that rc will be
overwritten if dev is nullptr.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/blkdev.cc

index 90d6c3f923ca10cc6fcd67e3d84871409c3433b7..26f3d580d2f2f552e25c095afb70f744414ac7e8 100644 (file)
@@ -197,7 +197,7 @@ int get_device_by_uuid(uuid_d dev_uuid, const char* label, char* partition,
   if (blkid_get_cache(&cache, NULL) >= 0)
     dev = blkid_find_dev_with_tag(cache, label, (const char*)uuid_str);
   else
-    rc = -EINVAL;
+    return -EINVAL;
 
   if (dev) {
     temp_partition_ptr = blkid_dev_devname(dev);