Re: [PATCH] gpio-tegra.c: fix wrong return code of tegra_gpio_probe() when devm_kzalloc() fails

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

 



Hi Jiecheng Wu,

On 08/18/2018 05:04 AM, Jiecheng Wu wrote:
> Function tegra_gpio_probe() defined in drivers/gpio/gpio-tegra.c calls devm_kzalloc(). As devm_kzalloc() may return NULL when OOM happens, the caller should return -ENOMEM when devm_kzalloc() fails.

please

1) change the subject line prefix to "gpio: tegra: ",
2) remove the first trivial sentence from the commit message,
3) put the commit message onto lines with 72 char line width.

And of course the commit message shall contain your Signed-off-by tag.

> ---
>  drivers/gpio/gpio-tegra.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
> index 47dbd19..f7a9ae7 100644
> --- a/drivers/gpio/gpio-tegra.c
> +++ b/drivers/gpio/gpio-tegra.c
> @@ -561,7 +561,7 @@ static int tegra_gpio_probe(struct platform_device *pdev)
>  
>  	tgi = devm_kzalloc(&pdev->dev, sizeof(*tgi), GFP_KERNEL);
>  	if (!tgi)
> -		return -ENODEV;
> +		return -ENOMEM;
>  
>  	tgi->soc = of_device_get_match_data(&pdev->dev);
>  	tgi->dev = &pdev->dev;
> 

--
Best wishes,
Vladimir



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux