Re: [PATCH] i2c/mux: (pinctrl) Fix probe error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 10 Nov 2012 19:22:22 -0800, Guenter Roeck wrote:
> 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@xxxxxxxxxxxx>
> ---
>  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 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;

Good catch. Applied, thanks. Will send to stable too.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux