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

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

Merge "drivers: qcom: rpmh: Check for valid input" into msm-4.9

parents 09a25055 1aa5d272
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -463,6 +463,9 @@ int rpmh_write_passthru(struct rpmh_client *rc, enum rpmh_state state,
	unsigned long flags;
	struct rpmh_mbox *rpm;

	if (IS_ERR_OR_NULL(rc) || !cmd || !n)
		return -EINVAL;

	if (rpmh_standalone)
		return 0;

@@ -478,7 +481,7 @@ int rpmh_write_passthru(struct rpmh_client *rc, enum rpmh_state state,
	while (n[count++])
		;
	count--;
	if (count >= RPMH_MAX_REQ_IN_BATCH)
	if (!count || count >= RPMH_MAX_REQ_IN_BATCH)
		return -EINVAL;

	if (state == RPMH_ACTIVE_ONLY_STATE || state == RPMH_AWAKE_STATE) {