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

Commit 95712444 authored by Kyle Piefer's avatar Kyle Piefer
Browse files

drivers: qcom: rpmh: Check for NULL pointer



Move the pointer dereference of the RPMh handle to
after the check for NULL in rpmh_invalidate.

CRs-Fixed: 2017390
Change-Id: Icbd5749faa28e14c708f8ecb62555628dce53194
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
parent 2ce06168
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -554,7 +554,7 @@ EXPORT_SYMBOL(rpmh_write_control);
int rpmh_invalidate(struct rpmh_client *rc)
{
	DEFINE_RPMH_MSG_ONSTACK(rc, 0, NULL, NULL, rpm_msg);
	struct rpmh_mbox *rpm = rc->rpmh;
	struct rpmh_mbox *rpm;

	if (IS_ERR_OR_NULL(rc))
		return -EINVAL;
@@ -562,6 +562,7 @@ int rpmh_invalidate(struct rpmh_client *rc)
	if (rpmh_standalone)
		return 0;

	rpm = rc->rpmh;
	rpm_msg.msg.invalidate = true;

	spin_lock(&rpm->lock);