projects/linux·commit aa1e3e81

i2c-mux-pinctrl: Fix probe error path

aa1e3e81 · Guenter Roeck <[email protected]> · 2012-11-13 22:27:19 +01:00

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 <[email protected]>
Cc: [email protected]
Signed-off-by: Jean Delvare <[email protected]>
Commit
aa1e3e81e75ceb3d977c3292cefafcd5179eb8b8
Parents
d85c8a6a

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/i2c/muxes/i2c-mux-pinctrl.cmodified+1−1View file

drivers/i2c/muxes/i2c-mux-pinctrl.c

View file
diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c
index 5f097f3..7fa5b24 100644
--- a/drivers/i2c/muxes/i2c-mux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c
@@ -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;