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

Commit 7192e8b5 authored by Sudheer Papothi's avatar Sudheer Papothi
Browse files

ASoC: wsa881x: Add check to avoid NULL pointer dereference



Add check to avoid NULL pointer dereference while getting
regmap structure for wsa881x codec.

Change-Id: I6ba00add0b4971ce092f79188eeb1e953bbdb459
Signed-off-by: default avatarSudheer Papothi <spapothi@codeaurora.org>
parent 55bc7ff0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -803,6 +803,9 @@ static struct regmap *wsa881x_get_regmap(struct device *dev)
{
	struct wsa881x_priv *control = swr_get_dev_data(to_swr_device(dev));

	if (!control)
		return NULL;

	return control->regmap;
}