summaryrefslogtreecommitdiff
path: root/drivers/md/dm-mpath.c
diff options
context:
space:
mode:
authortang.junhui <tang.junhui@zte.com.cn>2016-10-28 17:04:46 +0800
committerMike Snitzer <snitzer@redhat.com>2016-11-21 09:52:07 -0500
commitf97dc421280e16b8eb0c8f685610ba007ec11b79 (patch)
tree5875faeebf2956ba338516d9d2b750706b4a7fca /drivers/md/dm-mpath.c
parentbff7e067ee518f9ed7e1cbc63e4c9e01670d0b71 (diff)
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>
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r--drivers/md/dm-mpath.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index e477af8596e2..d234b6c33646 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -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;