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

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

[ Upstream commit ca6ac25cecf0e740d7cc8e03e0ebbf8acbeca3df ]

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>
Signed-off-by: NSasha Levin <sashal@kernel.org>
上级 b0d54e40
......@@ -692,7 +692,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.
先完成此消息的编辑!
想要评论请 注册