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:38:20 +0000 (09:38 -0700)
commite2fe6c3046ba3a75b3228181a34831b9bb8ee861
tree1f7b284f084443ef7b0b472ddf7e26b9bc1d4485
parent6d063730920d6bf76105473e67d7ed34bdef437f
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