From patchwork Thu Dec 13 13:57:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [094/241] i2c-mux-pinctrl: Fix probe error path Date: Thu, 13 Dec 2012 03:57:39 -0000 From: Herton Ronaldo Krzesinski X-Patchwork-Id: 205941 Message-Id: <1355407206-17100-95-git-send-email-herton.krzesinski@canonical.com> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Jean Delvare , Guenter Roeck 3.5.7.2 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Guenter Roeck 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: Herton Ronaldo Krzesinski --- drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 46a6697..c524018 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;