Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- drivers/md/dm-mpath.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 9fb91ca..f6d40d3 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -591,9 +591,7 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps kfree(m->hw_handler_params); m->hw_handler_params = NULL; } - } - - if (m->hw_handler_name) { + } else if (m->hw_handler_name) { /* * Increments scsi_dh reference, even when using an * already-attached handler. @@ -604,15 +602,15 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps dm_put_device(ti, p->path.dev); goto bad; } + } - if (m->hw_handler_params) { - r = scsi_dh_set_params(q, m->hw_handler_params); - if (r < 0) { - ti->error = "unable to set hardware " - "handler parameters"; - dm_put_device(ti, p->path.dev); - goto bad; - } + if (m->hw_handler_name && m->hw_handler_params) { + r = scsi_dh_set_params(q, m->hw_handler_params); + if (r < 0) { + ti->error = "unable to set hardware " + "handler parameters"; + dm_put_device(ti, p->path.dev); + goto bad; } } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html