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

Commit cfc9a559 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: wcd9xxx: check NULL pointer access for wcd9xxx"

parents 91cdb85c 5055f775
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1689,6 +1689,10 @@ static int wcd9xxx_device_up(struct wcd9xxx *wcd9xxx)
static int wcd9xxx_slim_device_up(struct slim_device *sldev)
{
	struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev);
	if (!wcd9xxx) {
		pr_err("%s: wcd9xxx is NULL\n", __func__);
		return -EINVAL;
	}
	dev_dbg(wcd9xxx->dev, "%s: device up\n", __func__);
	return wcd9xxx_device_up(wcd9xxx);
}
@@ -1697,6 +1701,10 @@ static int wcd9xxx_slim_device_down(struct slim_device *sldev)
{
	struct wcd9xxx *wcd9xxx = slim_get_devicedata(sldev);

	if (!wcd9xxx) {
		pr_err("%s: wcd9xxx is NULL\n", __func__);
		return -EINVAL;
	}
	wcd9xxx_irq_exit(&wcd9xxx->core_res);
	if (wcd9xxx->dev_down)
		wcd9xxx->dev_down(wcd9xxx);