In checker_get func, input name will be checked before
calling checker_class_lookup func, in which name will
also be checked.

Here, we just remove useless input name check in checker_get func.

Signed-off-by: Zhiqiang Liu <liuzhiqian...@huawei.com>
Signed-off-by: lixiaokeng <lixiaok...@huawei.com>
---
 libmultipath/checkers.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c
index f7ddd53..ac41d64 100644
--- a/libmultipath/checkers.c
+++ b/libmultipath/checkers.c
@@ -361,11 +361,10 @@ void checker_get(const char *multipath_dir, struct 
checker *dst,
        if (!dst)
                return;

-       if (name && strlen(name)) {
-               src = checker_class_lookup(name);
-               if (!src)
-                       src = add_checker_class(multipath_dir, name);
-       }
+       src = checker_class_lookup(name);
+       if (!src)
+               src = add_checker_class(multipath_dir, name);
+
        dst->cls = src;
        if (!src)
                return;
-- 
1.8.3.1



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to