提交 ca6ac25c 编写于 作者: S Srinivas Kandagatla 提交者: Greg Kroah-Hartman

nvmem: core: return error code instead of NULL from nvmem_device_get

nvmem_device_get() should return ERR_PTR() on error or valid pointer
on success, but one of the code path seems to return NULL, so fix it.
Reported-by: NNiklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0181cfd9
......@@ -679,7 +679,7 @@ static struct nvmem_device *nvmem_find(const char *name)
d = bus_find_device_by_name(&nvmem_bus_type, NULL, name);
if (!d)
return NULL;
return ERR_PTR(-ENOENT);
return to_nvmem_device(d);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册