]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dm mpath: add m->hw_handler_name NULL pointer check in parse_hw_handler()
authortang.junhui <tang.junhui@zte.com.cn>
Fri, 28 Oct 2016 09:04:46 +0000 (17:04 +0800)
committerMike Snitzer <snitzer@redhat.com>
Mon, 21 Nov 2016 14:52:07 +0000 (09:52 -0500)
Avoids false positive of no hardware handler being specified (which is
implied by a NULL m->hw_handler_name).

Signed-off-by: tang.junhui <tang.junhui@zte.com.cn>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c

index e477af8596e276c6665ec97042041b9397188f22..d234b6c33646f6d9e9387fb64ca85d803bade53f 100644 (file)
@@ -1002,6 +1002,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m)
        }
 
        m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);
+       if (!m->hw_handler_name)
+               return -EINVAL;
 
        if (hw_argc > 1) {
                char *p;