nvmem: fix nvmem_cell_get_from_lookup()
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 3 Oct 2018 07:31:11 +0000 (09:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Oct 2018 13:56:15 +0000 (15:56 +0200)
commitcccb3b19e762edc8ef0481be506967555cb9e317
treea18f24999e6132cadd504a74e9da2abd9e7067cf
parentbadcdff107cbfd7fef5f089260177efc56fe1a9f
nvmem: fix nvmem_cell_get_from_lookup()

We check if the pointer returned by __nvmem_device_get() is not NULL
while we should actually check if it is not IS_ERR(nvmem). Fix it.

While we're at it: fix the next error path where we should assign an
error value to cell before returning.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c