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

Commit 17d98dbd authored by Xiaojun Sang's avatar Xiaojun Sang
Browse files

ASoC: wcd: add null check before pointer dereference



Slimbus device pointer may be null, which may lead to
null pointer dereference.

CRs-Fixed: 1054973
Signed-off-by: default avatarXiaojun Sang <xsang@codeaurora.org>
Change-Id: Ica22ee19f281fa0cff7d629f396c41c935692c59
parent 4e2a8a0f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1219,6 +1219,11 @@ static int wcd9xxx_slim_probe(struct slim_device *slim)

	intf_type = wcd9xxx_get_intf_type();

	if (!slim) {
		ret = -EINVAL;
		goto err;
	}

	if (intf_type == WCD9XXX_INTERFACE_TYPE_I2C) {
		dev_dbg(&slim->dev, "%s:Codec is detected in I2C mode\n",
			__func__);