From 37a02bab1e718706aa5af65f34ea2bfee1649854 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 2 Dec 2013 15:31:42 -0500 Subject: [PATCH] storage_driver: Resolve Coverity CHECKED_RETURN warning The storageRegister() didn't check the return from the virRegisterStorageDriver() like other callers did, so Coverity flagged it. Just check the return and handle. --- src/storage/storage_driver.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 3b4715a240..f08255ea0e 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2644,8 +2644,10 @@ static virStateDriver stateDriver = { .stateReload = storageStateReload, }; -int storageRegister(void) { - virRegisterStorageDriver(&storageDriver); +int storageRegister(void) +{ + if (virRegisterStorageDriver(&storageDriver) < 0) + return -1; virRegisterStateDriver(&stateDriver); return 0; }