diff options
author | tang.junhui <tang.junhui@zte.com.cn> | 2016-10-28 17:04:46 +0800 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2016-11-21 09:52:07 -0500 |
commit | f97dc421280e16b8eb0c8f685610ba007ec11b79 (patch) | |
tree | 5875faeebf2956ba338516d9d2b750706b4a7fca | |
parent | bff7e067ee518f9ed7e1cbc63e4c9e01670d0b71 (diff) | |
download | linux-f97dc421280e16b8eb0c8f685610ba007ec11b79.tar.gz linux-f97dc421280e16b8eb0c8f685610ba007ec11b79.tar.bz2 linux-f97dc421280e16b8eb0c8f685610ba007ec11b79.zip |
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>
-rw-r--r-- | drivers/md/dm-mpath.c | 2 |
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; |