When storage id is invalid GetDeviceInfo return with id which is less than 0 22/178122/1 accepted/tizen/unified/20180509.072933 submit/tizen/20180508.075947
authorpr.jung <pr.jung@samsung.com>
Tue, 8 May 2018 07:30:50 +0000 (16:30 +0900)
committerpr.jung <pr.jung@samsung.com>
Tue, 8 May 2018 07:30:50 +0000 (16:30 +0900)
Change-Id: I851d7d457c2e341a753adb4dfc951a150c4fee1e
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/storage-external-dbus.c

index 4568371..8b66ca3 100755 (executable)
@@ -493,6 +493,11 @@ int storage_ext_get_device_info(int storage_id, storage_ext_device *info)
                return -ENODEV;
        }
 
+       if (info->storage_id < 0) {
+               _E("No storage with the storage id (%d)", storage_id); //LCOV_EXCL_LINE
+               return -ENODEV;
+       }
+
        g_variant_unref(result);
 
        return 0;