ARM: SAMSUNG: Fixup prevent bug related to 'Unchecked return value'
Subsystems (3)
PATCH 1/1 ARM: SAMSUNG: Fixup prevent bug related to 'Unchecked return value'
[prevent bug]
In s5p_pmu_init(): Value returned from a function is not checked for erros before being used.
Signed-off-by Huisung Kang <[email protected]>
--- arch/arm/plat-samsung/devs.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
arch/arm/plat-samsung/devs.c +8 -1
@@ -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);
Signature · 1 line
1.7.1
PATCH 1/1 ARM: SAMSUNG: Fixup prevent bug related to 'Unchecked return value'
Quoted 32 lines · Huisung Kang
[prevent bug]
Ins5p_pmu_init(): Value returned from a function is not checked for erros before being used.Signed-off-by Huisung Kang <[email protected]>--- arch/arm/plat-samsung/devs.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)arch/arm/plat-samsung/devs.c +8
-2@@ -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); --
Quoted 1 line
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 <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.