regmap: fix NULL pointer dereference in _regmap_write/read
authorPankaj Dubey <pankaj.dubey@samsung.com>
Sat, 27 Sep 2014 04:17:55 +0000 (09:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:35:10 +0000 (09:35 -0700)
commita110e6d6ebac622c30c9d219b5b154d3d3167a20
tree906285b12140501352c9eed372cfca633ce5b314
parentd9aa4aecb2e94ca383789147769291e8723ecf86
regmap: fix NULL pointer dereference in _regmap_write/read

commit 5336be8416a71b5568d2cf54a2f2066abe9f2a53 upstream.

If LOG_DEVICE is defined and map->dev is NULL it will lead to NULL
pointer dereference. This patch fixes this issue by adding check for
dev->NULL in all such places in regmap.c

Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/regmap/regmap.c