From: Guenter Roeck Date: Tue, 13 Nov 2012 21:27:19 +0000 (+0100) Subject: i2c-mux-pinctrl: Fix probe error path X-Git-Tag: v3.6.8~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c0b531309e4c685cad1a4e4e7a014829deee49;p=thirdparty%2Fkernel%2Fstable.git i2c-mux-pinctrl: Fix probe error path 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 Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 46a6697634760..c52401845e1f5 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;