From: tang.junhui Date: Fri, 28 Oct 2016 09:04:46 +0000 (+0800) Subject: dm mpath: add m->hw_handler_name NULL pointer check in parse_hw_handler() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f97dc421280e16b8eb0c8f685610ba007ec11b79;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Mike Snitzer --- 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;