RE: [PATCH] ARM: SAMSUNG: Fixup prevent bug related to 'Unchecked return value'

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

 



Huisung Kang wrote:
> 
> 
> [prevent bug]
> In s5p_pmu_init(): Value returned from a function is not checked for
> erros before being used.
> 
> Signed-off-by: Huisung Kang <hs1218.kang@xxxxxxxxxxx>
> ---
>  arch/arm/plat-samsung/devs.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> index 3e38dc4..3e6e1f2 100644
> --- a/arch/arm/plat-samsung/devs.c
> +++ b/arch/arm/plat-samsung/devs.c
> @@ -1092,7 +1092,14 @@ struct platform_device s5p_device_pmu = {
> 
>  static int __init s5p_pmu_init(void)
>  {
> -	platform_device_register(&s5p_device_pmu);
> +	int ret;
> +
> +	ret = platform_device_register(&s5p_device_pmu);
> +	if (ret) {
> +		pr_warning("s5p_pmu_init: pmu device not registered.\n");
> +		return ret;
> +	}
> +
>  	return 0;
>  }
>  arch_initcall(s5p_pmu_init);
> --
> 1.7.1

I think, in this case, following can be used instead.

	return platform_device_register(&s5p_device_pmu);

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@xxxxxxxxxxx>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.

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


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux