master - filters: Alwayz zalloc the filter struct.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=012d273ede86f0e3e894b0e907f7f623c3dda7e0 Commit: 012d273ede86f0e3e894b0e907f7f623c3dda7e0 Parent: 376cb3fe64c4874fe4276722c4276521481dc80b Author: Petr Rockai <[email protected]> AuthorDate: Sat Aug 18 18:59:07 2012 +0200 Committer: Petr Rockai <[email protected]> CommitterDate: Wed Sep 26 12:23:34 2012 +0200
filters: Alwayz zalloc the filter struct.
Not all pointers need to be initialised explicitly that way.
--- lib/filters/filter-composite.c | 2 +- lib/filters/filter-md.c | 2 +- lib/filters/filter-mpath.c | 2 +- lib/filters/filter-persistent.c | 2 +- lib/filters/filter.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
lib/filters/filter-composite.c +1 -1
@@ -64,7 +64,7 @@ struct dev_filter *composite_filter_create(int n, struct dev_filter **filters)memcpy (filters_copy, filters,sizeof (*filters) * n); filters_copy[n] =NULL ; -if (!(cft =dm_malloc (sizeof (*cft)))) { +if (!(cft =dm_zalloc (sizeof (*cft)))) {log_error ("compsoite filters allocation failed" );dm_free (filters_copy);return NULL ;
lib/filters/filter-md.c +1 -1
@@ -54,7 +54,7 @@ struct dev_filter *md_filter_create(void) {struct dev_filter *f; -if (!(f =dm_malloc (sizeof (*f)))) { +if (!(f =dm_zalloc (sizeof (*f)))) {log_error ("md filter allocation failed" );return NULL ; }
lib/filters/filter-mpath.c +1 -1
@@ -185,7 +185,7 @@ struct dev_filter *mpath_filter_create(const char *sysfs_dir)return NULL ; } -if (!(f =dm_malloc (sizeof (*f)))) { +if (!(f =dm_zalloc (sizeof (*f)))) {log_error ("mpath filter allocation failed" );return NULL ; }
lib/filters/filter-persistent.c +1 -1
@@ -355,7 +355,7 @@ struct dev_filter *persistent_filter_create(struct dev_filter *real, goto bad; } -if (!(f =dm_malloc (sizeof (*f)))) { +if (!(f =dm_zalloc (sizeof (*f)))) {log_error ("Allocation of device filter for persistent filter failed." ); goto bad; }
lib/filters/filter.c +1 -1
@@ -325,7 +325,7 @@ struct dev_filter *lvm_type_filter_create(const char *proc, {struct dev_filter *f; -if (!(f =dm_malloc (sizeof (struct dev_filter )))) { +if (!(f =dm_zalloc (sizeof (struct dev_filter )))) {log_error ("LVM type filter allocation failed" );return NULL ; }