memory: jz4780_nemc: Fix an error pointer vs NULL check in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 3 Aug 2020 14:36:07 +0000 (17:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:27 +0000 (11:54 +0100)
commite6fc90d170df77583edc90d132a796d3abda1fba
tree5e696b2a8bf38bd22a90546b2a8368cb6a7579bd
parentc88347ae936482f079cc17eac405f3f54e839a8d
memory: jz4780_nemc: Fix an error pointer vs NULL check in probe()

commit 96999c797ec1ef41259f00b4ddf9cf33b342cb78 upstream.

The devm_ioremap() function returns NULL on error, it doesn't return
error pointers.  This bug could lead to an Oops during probe.

Fixes: f046e4a3f0b9 ("memory: jz4780_nemc: Only request IO memory the driver will use")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20200803143607.GC346925@mwanda
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/memory/jz4780-nemc.c