mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Check if info struct returned is not NULL.
Just some missing checks revealed by Coverity in recent code.
This commit is contained in:
parent
2d6f57be7e
commit
fb4f76a29c
5
lib/cache/lvmetad.c
vendored
5
lib/cache/lvmetad.c
vendored
@ -138,8 +138,9 @@ static struct lvmcache_info *_pv_populate_lvmcache(
|
||||
if (!vgname)
|
||||
vgname = fmt->orphan_vg_name;
|
||||
|
||||
info = lvmcache_add(fmt->labeller, (const char *)&pvid, device,
|
||||
vgname, (const char *)&vgid, 0);
|
||||
if (!(info = lvmcache_add(fmt->labeller, (const char *)&pvid, device,
|
||||
vgname, (const char *)&vgid, 0)))
|
||||
return_NULL;
|
||||
|
||||
lvmcache_get_label(info)->sector = label_sector;
|
||||
lvmcache_set_device_size(info, devsize);
|
||||
|
@ -1455,6 +1455,9 @@ static int _text_pv_read(const struct format_type *fmt, const char *pv_name,
|
||||
info = label->info;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
return_0;
|
||||
|
||||
if (!lvmcache_populate_pv_fields(info, pv, scan_label_only))
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user