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

Commit 9ceb8ed4 authored by Surendar karka's avatar Surendar karka
Browse files

swr-wcd-ctrl: add check for end of soundwire port list



Crash is observed due to out of bound access after
end of list. Add condition to check end of list.

CRs-Fixed: 2046323
Change-Id: Icf01b0265578099813a8572659c985eb4dcd309b
Signed-off-by: default avatarSurendar karka <sukark@codeaurora.org>
parent a3dbc7bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2017, 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
@@ -753,7 +753,7 @@ inc_loop:
			list_del(&mport->list);
			kfree(mport);
		}
		if (!mport_next) {
		if (!mport_next || (&mport_next->list == &swrm->mport_list)) {
			dev_err(swrm->dev, "%s: end of list\n", __func__);
			break;
		}