Due to the way that our virObjectUnref() is written it's not
possible that a NULL is passed into *Dispose() function. However,
some functions check for that regardless.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 3 ---
src/conf/virstorageobj.c | 9 ---------
src/rpc/virnetsshsession.c | 3 ---
src/util/virhostdev.c | 3 ---
4 files changed, 18 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a3a514136b..732d37329f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2602,9 +2602,6 @@ virDomainChrSourceDefDispose(void *obj)
virDomainChrSourceDefPtr def = obj;
size_t i;
- if (!def)
- return;
-
virDomainChrSourceDefClear(def);
virObjectUnref(def->privateData);
diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index cdd9863eb8..31b5af8e9e 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -156,9 +156,6 @@ virStorageVolObjDispose(void *opaque)
{
virStorageVolObjPtr obj = opaque;
- if (!obj)
- return;
-
virStorageVolDefFree(obj->voldef);
}
@@ -190,9 +187,6 @@ virStorageVolObjListDispose(void *opaque)
{
virStorageVolObjListPtr vols = opaque;
- if (!vols)
- return;
-
virHashFree(vols->objsKey);
virHashFree(vols->objsName);
virHashFree(vols->objsPath);
@@ -362,9 +356,6 @@ virStoragePoolObjDispose(void *opaque)
{
virStoragePoolObjPtr obj = opaque;
- if (!obj)
- return;
-
virStoragePoolObjClearVols(obj);
virObjectUnref(obj->volumes);
diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c
index 324b35b675..04b720014d 100644
--- a/src/rpc/virnetsshsession.c
+++ b/src/rpc/virnetsshsession.c
@@ -135,9 +135,6 @@ virNetSSHSessionDispose(void *obj)
virNetSSHSessionPtr sess = obj;
VIR_DEBUG("sess=0x%p", sess);
- if (!sess)
- return;
-
if (sess->channel) {
libssh2_channel_send_eof(sess->channel);
libssh2_channel_close(sess->channel);
diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 19ae001971..fe176f35e4 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -131,9 +131,6 @@ virHostdevManagerDispose(void *obj)
{
virHostdevManagerPtr hostdevMgr = obj;
- if (!hostdevMgr)
- return;
-
virObjectUnref(hostdevMgr->activePCIHostdevs);
virObjectUnref(hostdevMgr->inactivePCIHostdevs);
virObjectUnref(hostdevMgr->activeUSBHostdevs);
--
2.21.0