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

Commit 161d55c3 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails

parent d2b4c7bd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -857,6 +857,7 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c,
	ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1);
	if (ret != 0) {
		dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret);
		kfree(sta32x);
		return ret;
	}