mmc: dw_mmc-pltfm: fix the potential NULL pointer dereference
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 21 Oct 2016 10:57:57 +0000 (19:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2016 15:36:35 +0000 (16:36 +0100)
commita1ffa7c37a4c0fc58b921daa3036e4206b864745
tree33171a65913aede14711dc65c7dbdb8d5e70fe95
parentc77a2346226e77e3f1d243810eb2bb75b407f2b4
mmc: dw_mmc-pltfm: fix the potential NULL pointer dereference

commit 45c7a4908a307a023e237a64a3eadcafc4836493 upstream.

platform_get_resource can be returned the NULL pointer.
Then regs->start should be referred to NULL Pointer.
devm_ioremap_resource() checks whether res is NULL or not.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/dw_mmc-pltfm.c