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

Commit dd78809e authored by David Dai's avatar David Dai
Browse files

msm: msm_bus: Check for invalid current voting index



Check for negative values in current voting index when attempting
to unregister a device and default to 0. This can happen when clients
have yet to make a vote after registration and attempt to unregister
right away.

Change-Id: I8a384a98984964756c569d09be4bb3a0614b475c
Signed-off-by: default avatarDavid Dai <daidavid1@codeaurora.org>
parent 85a10b57
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1133,7 +1133,7 @@ static void unregister_client_adhoc(uint32_t cl)
	}

	curr = client->curr;
	if (curr >= pdata->num_usecases) {
	if (curr >= pdata->num_usecases || curr < 0) {
		MSM_BUS_ERR("Invalid index Defaulting curr to 0");
		curr = 0;
	}