dm: remove redundant null check in unregister_mem_init

return value 'err' of mmio_rb_lookup() being 0 ensures
  'entry' is not NULL, hence checking it before 'free(entry)'
  is unnecessary.

Tracked-On: #6157
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang 2021-06-07 14:35:06 +08:00 committed by wenlingz
parent f87e46bf45
commit ccf606bded

View File

@ -249,8 +249,7 @@ unregister_mem_int(struct mmio_rb_tree *rbt, struct mem_range *memp)
if (mmio_hint == entry)
mmio_hint = NULL;
if (entry)
free(entry);
free(entry);
}
}
pthread_rwlock_unlock(&mmio_rwlock);