X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-path-selector.c;h=ca1bb636a3e4ba808ae63d88dfbb62bc4ee28a04;hb=f2d7499be1b1fe1cd8a5e6a01c1f44173894a241;hp=a28c1c2b4ef5c703d2d5ce4f5c67bb2858483542;hpb=ad34ea2cc3845ef4dcd7d12fb0fa8484734bd672;p=linux-2.6 diff --git a/drivers/md/dm-path-selector.c b/drivers/md/dm-path-selector.c index a28c1c2b4e..ca1bb636a3 100644 --- a/drivers/md/dm-path-selector.c +++ b/drivers/md/dm-path-selector.c @@ -86,8 +86,7 @@ void dm_put_path_selector(struct path_selector_type *pst) if (--psi->use == 0) module_put(psi->pst.module); - if (psi->use < 0) - BUG(); + BUG_ON(psi->use < 0); out: up_read(&_ps_lock); @@ -95,12 +94,10 @@ out: static struct ps_internal *_alloc_path_selector(struct path_selector_type *pst) { - struct ps_internal *psi = kmalloc(sizeof(*psi), GFP_KERNEL); + struct ps_internal *psi = kzalloc(sizeof(*psi), GFP_KERNEL); - if (psi) { - memset(psi, 0, sizeof(*psi)); + if (psi) psi->pst = *pst; - } return psi; }