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

Commit aa1e3e81 authored by Guenter Roeck's avatar Guenter Roeck Committed by Jean Delvare
Browse files

i2c-mux-pinctrl: Fix probe error path



When allocating the memory for i2c busses, the code checked the wrong
variable and thus never detected if there was a memory error.

Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent d85c8a6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -169,7 +169,7 @@ static int __devinit i2c_mux_pinctrl_probe(struct platform_device *pdev)
	mux->busses = devm_kzalloc(&pdev->dev,
	mux->busses = devm_kzalloc(&pdev->dev,
				   sizeof(mux->busses) * mux->pdata->bus_count,
				   sizeof(mux->busses) * mux->pdata->bus_count,
				   GFP_KERNEL);
				   GFP_KERNEL);
	if (!mux->states) {
	if (!mux->busses) {
		dev_err(&pdev->dev, "Cannot allocate busses\n");
		dev_err(&pdev->dev, "Cannot allocate busses\n");
		ret = -ENOMEM;
		ret = -ENOMEM;
		goto err;
		goto err;