]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i2c-mux-pinctrl: Fix probe error path
authorGuenter Roeck <linux@roeck-us.net>
Tue, 13 Nov 2012 21:27:19 +0000 (22:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Nov 2012 20:14:10 +0000 (12:14 -0800)
commit aa1e3e81e75ceb3d977c3292cefafcd5179eb8b8 upstream.

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>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/muxes/i2c-mux-pinctrl.c

index 46a669763476053be99d5601cb07c6d2dd0cd8e0..c52401845e1f547dcab959b87917ecd54f6ff0f2 100644 (file)
@@ -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;