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

Commit 3a6797bf authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

qcom: ssr: Unlock the ssr_order mutex before returning



Currently, the ssr_order_mutex is not unlocked if the function
returns early or with an error. Correct this to avoid deadlock.

Change-Id: I5c41723492fd912cf5279bc97bd5314856903050
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 1d3124ad
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -1177,9 +1177,11 @@ static struct subsys_soc_restart_order *ssr_parse_restart_orders(struct
		}

		if (num == count && tmp->count == count)
			return tmp;
		else if (num)
			return ERR_PTR(-EINVAL);
			goto err;
		else if (num) {
			tmp = ERR_PTR(-EINVAL);
			goto err;
		}
	}

	order->count = count;
@@ -1191,6 +1193,9 @@ static struct subsys_soc_restart_order *ssr_parse_restart_orders(struct
	mutex_unlock(&ssr_order_mutex);

	return order;
err:
	mutex_unlock(&ssr_order_mutex);
	return tmp;
}

static int __get_gpio(struct subsys_desc *desc, const char *prop,