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

Commit 0e8b95d2 authored by Laxminath Kasam's avatar Laxminath Kasam Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: soundwire: add null check before dereference



In soundwire driver, update null check in swr_dev_release API
to avoid dereference null pointer.

CRs-Fixed: 873914
Change-Id: I03ccf6096ce06e82d2ee6465e585e07fae537fb8
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent 6b6b4c37
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -53,9 +53,12 @@ static struct swr_master *swr_master_get(struct swr_master *master)
static void swr_dev_release(struct device *dev)
{
	struct swr_device *swr_dev = to_swr_device(dev);
	struct swr_master *master = swr_dev->master;
	struct swr_master *master;

	if (!swr_dev || !master)
	if (!swr_dev)
		return;
	master = swr_dev->master;
	if (!master)
		return;
	mutex_lock(&master->mlock);
	list_del_init(&swr_dev->dev_list);