dm mpath: add m->hw_handler_name NULL pointer check in parse_hw_handler()

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>
This commit is contained in:
tang.junhui 2016-10-28 17:04:46 +08:00 committed by Mike Snitzer
parent bff7e067ee
commit f97dc42128
1 changed files with 2 additions and 0 deletions

View 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;