Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1c194d

Browse files
vkochan-plvgregkh
authored andcommitted
nvmem: core: fix missing of_node_put() in of_nvmem_device_get()
of_parse_phandle() returns device_node with incremented ref countwhich needs to be decremented by of_node_put() when device_nodeis not used.Fixes:e2a5402 ("nvmem: Add nvmem_device based consumer apis.")Signed-off-by: Vadym Kochan <vadym.kochan@plvision.eu>Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>Link:https://lore.kernel.org/r/20200917134437.16637-5-srinivas.kandagatla@linaro.orgSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent1eb51d6 commitb1c194d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎drivers/nvmem/core.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *id)
835835
{
836836

837837
structdevice_node*nvmem_np;
838+
structnvmem_device*nvmem;
838839
intindex=0;
839840

840841
if (id)
@@ -844,7 +845,9 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *id)
844845
if (!nvmem_np)
845846
returnERR_PTR(-ENOENT);
846847

847-
return__nvmem_device_get(nvmem_np,device_match_of_node);
848+
nvmem=__nvmem_device_get(nvmem_np,device_match_of_node);
849+
of_node_put(nvmem_np);
850+
returnnvmem;
848851
}
849852
EXPORT_SYMBOL_GPL(of_nvmem_device_get);
850853
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp