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

Commit 353d4644 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "clk: msm: clock-cpu: Avoid NULL pointer dereference"

parents 21d72fd8 d886ace2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -489,6 +489,11 @@ static int add_opp(struct clk *c, struct device *cpudev, struct device *vregdev,
	struct dev_pm_opp *oppl;
	int j = 1;

	if (!cpudev) {
		pr_warn("clock-cpu: NULL CPU device\n");
		return -ENODEV;
	}

	rcu_read_lock();
	/* Check if the regulator driver has already populated OPP tables */
	oppl = dev_pm_opp_find_freq_exact(vregdev, 2, true);
+5 −0
Original line number Diff line number Diff line
@@ -499,6 +499,11 @@ static int add_opp(struct clk *c, struct device *dev, unsigned long max_rate)
	bool first = true;
	int j = 1;

	if (!dev) {
		pr_warn("clock-cpu: NULL CPU device\n");
		return -ENODEV;
	}

	while (1) {
		rate = c->fmax[j++];
		level = find_vdd_level(c, rate);
+5 −0
Original line number Diff line number Diff line
@@ -686,6 +686,11 @@ static int add_opp(struct clk *c, struct device *cpudev,
	long ret, uv, corner;
	int j = 1;

	if (!cpudev) {
		pr_warn("clock-cpu: NULL CPU device\n");
		return -ENODEV;
	}

	while (1) {
		rate = c->fmax[j++];