Skip to content

Commit

Permalink
i2c-mux-pinctrl: Fix probe error path
Browse files Browse the repository at this point in the history
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: Guenter Roeck <linux@roeck-us.net>
Cc: stable@vger.kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Guenter Roeck authored and Jean Delvare committed Nov 13, 2012
1 parent d85c8a6 commit aa1e3e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/muxes/i2c-mux-pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static int __devinit i2c_mux_pinctrl_probe(struct platform_device *pdev)
mux->busses = devm_kzalloc(&pdev->dev,
sizeof(mux->busses) * mux->pdata->bus_count,
GFP_KERNEL);
if (!mux->states) {
if (!mux->busses) {
dev_err(&pdev->dev, "Cannot allocate busses\n");
ret = -ENOMEM;
goto err;
Expand Down

0 comments on commit aa1e3e8

Please sign in to comment.