提交 295b1d10 编写于 作者: S Steven Price 提交者: Yang Yingliang

firmware: arm_scmi: fix of_node leak in scmi_mailbox_check

[ Upstream commit fa7fe29a645b4da08efe8ff2392898b88f9ded9f ]

of_parse_phandle_with_args() requires the caller to call of_node_put() on
the returned args->np pointer. Otherwise the reference count will remain
incremented.

However, in this case, since we don't actually use the returned pointer,
we can simply pass in NULL.

Fixes: aa4f886f ("firmware: arm_scmi: add basic driver infrastructure for SCMI")
Signed-off-by: NSteven Price <steven.price@arm.com>
Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 4111c4ff
...@@ -662,9 +662,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo) ...@@ -662,9 +662,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)
static int scmi_mailbox_check(struct device_node *np) static int scmi_mailbox_check(struct device_node *np)
{ {
struct of_phandle_args arg; return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, NULL);
return of_parse_phandle_with_args(np, "mboxes", "#mbox-cells", 0, &arg);
} }
static int scmi_mbox_free_channel(int id, void *p, void *data) static int scmi_mbox_free_channel(int id, void *p, void *data)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册