mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix segfault in persistent_filter_dump() if lvm init fails.
Just return_0 in persistent_filter_dump() if passed a NULL filter;
This commit is contained in:
parent
71e41d9139
commit
f882633886
@ -177,7 +177,7 @@ static void _write_array(struct pfilter *pf, FILE *fp, const char *path,
|
||||
|
||||
int persistent_filter_dump(struct dev_filter *f)
|
||||
{
|
||||
struct pfilter *pf = (struct pfilter *) f->private;
|
||||
struct pfilter *pf;
|
||||
char *tmp_file;
|
||||
struct stat info, info2;
|
||||
struct config_tree *cft = NULL;
|
||||
@ -185,6 +185,10 @@ int persistent_filter_dump(struct dev_filter *f)
|
||||
int lockfd;
|
||||
int r = 0;
|
||||
|
||||
if (!f)
|
||||
return_0;
|
||||
pf = (struct pfilter *) f->private;
|
||||
|
||||
if (!dm_hash_get_num_entries(pf->devices)) {
|
||||
log_very_verbose("Internal persistent device cache empty "
|
||||
"- not writing to %s", pf->file);
|
||||
|
Loading…
Reference in New Issue
Block a user