Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6de805f9 authored by Patrick Daly's avatar Patrick Daly
Browse files

clk: qcom: Check arguments to clk_set_parent



Verify that the struct clk pointer is valid before accessing
its members.

Change-Id: I8b7cd5dac1a170b8362c9f88b853c3f55d688b6c
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent b5a909ab
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -609,6 +609,8 @@ EXPORT_SYMBOL(clk_get_parent_sel);
int clk_set_parent(struct clk *clk, struct clk *parent)
{
	int rc = 0;
	if (IS_ERR_OR_NULL(clk))
		return -EINVAL;

	if (!clk->ops->set_parent && clk->parent == parent)
		return 0;