conf: Add check to avoid a NULL compare for SysfsPath
If the two sysfs_path are both NULL, there may be an incorrect object returned for virNodeDeviceObjListFindBySysfsPath(). This check exists in old interface virNodeDeviceFindBySysfsPath(). e.g. virNodeDeviceFindBySysfsPath(virNodeDeviceObjListPtr devs, const char *sysfs_path) { ... if ((devs->objs[i]->def->sysfs_path != NULL) && (STREQ(devs->objs[i]->def->sysfs_path, sysfs_path))) { ... } Reviewed-by: NCole Robinson <crobinso@redhat.com> Signed-off-by: NCheng Lin <cheng.lin130@zte.com.cn>
Showing
想要评论请 注册 或 登录