]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
regmap: debugfs: fix possbile NULL pointer dereference
authorXiubo Li <Li.Xiubo@freescale.com>
Sun, 28 Sep 2014 03:35:25 +0000 (11:35 +0800)
committerJiri Slaby <jslaby@suse.cz>
Fri, 31 Oct 2014 14:11:11 +0000 (15:11 +0100)
commit71922da4fea3b75fd9ade739d6f97e4a9af77015
tree67969df4667c022283d641641bfd69ef54206673
parenteeef301b6d8d548d8577cfb14ca1c56ca323bfb7
regmap: debugfs: fix possbile NULL pointer dereference

commit 2c98e0c1cc6b8e86f1978286c3d4e0769ee9d733 upstream.

If 'map->dev' is NULL and there will lead dev_name() to be NULL pointer
dereference. So before dev_name(), we need to have check of the map->dev
pionter.

We also should make sure that the 'name' pointer shouldn't be NULL for
debugfs_create_dir(). So here using one default "dummy" debugfs name when
the 'name' pointer and 'map->dev' are both NULL.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/base/regmap/regmap-debugfs.c