ARM: OMAP2+: Powerdomain: Fix unchecked dereference of arch_pwrdm
Subsystems (3)
PATCH 1/1 ARM: OMAP2+: Powerdomain: Fix unchecked dereference of arch_pwrdm
Commit 'cd8abed' "ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm" leads to the following Smatch complaint:
arch/arm/mach-omap2/powerdomain.c:131 _pwrdm_register()
error: we previously assumed 'arch_pwrdm' could be null (see line 105)
So, fix the unchecked dereference of arch_pwrdm.
--- arch/arm/mach-omap2/powerdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/powerdomain.c +2 -1
@@ -128,7 +128,8 @@ skip_voltdm:for (i =0 ; i < pwrdm->banks; i++) pwrdm->ret_mem_off_counter[i] =0 ; - arch_pwrdm->pwrdm_wait_transition (pwrdm); +if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition) + arch_pwrdm->pwrdm_wait_transition (pwrdm); pwrdm->state =pwrdm_read_pwrst (pwrdm); pwrdm->state_counter[pwrdm->state] =1 ;
Signature · 1 line
1.7.9.5
Quoted 21 lines · Rajendra Nayak
Commit 'cd8abed' "ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm" leads to the following Smatch complaint:
arch/arm/mach-omap2/powerdomain.c:131_pwrdm_register()
error: we previously assumed 'arch_pwrdm' could be null (see line 105)So, fix the unchecked dereference of
arch_pwrdm.Reported-by Dan Carpenter <[email protected]>Signed-off-by Rajendra Nayak <[email protected]>--- arch/arm/mach-omap2/powerdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/mach-omap2/powerdomain.c +0
-0
arch/arm/mach-omap2/powerdomain.c skip_voltdm: · line 135
Quoted 9 lines
arch/arm/mach-omap2/powerdomain.c +2
-1@@ -128,7 +128,8 @@ skip_voltdm:for (i =0 ; i < pwrdm->banks; i++) pwrdm->ret_mem_off_counter[i] =0 ; - arch_pwrdm->pwrdm_wait_transition (pwrdm); +if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition) + arch_pwrdm->pwrdm_wait_transition (pwrdm); pwrdm->state =pwrdm_read_pwrst (pwrdm); pwrdm->state_counter[pwrdm->state] =1 ;
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerQuoted 24 lines · Nishanth Menon
Quoted 23 lines · Rajendra Nayak
Commit 'cd8abed' "ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm" leads to the following Smatch complaint:
arch/arm/mach-omap2/powerdomain.c:131_pwrdm_register()
error: we previously assumed 'arch_pwrdm' could be null (see line 105)So, fix the unchecked dereference of
arch_pwrdm.Reported-by Dan Carpenter <[email protected]>Signed-off-by Rajendra Nayak <[email protected]>--- arch/arm/mach-omap2/powerdomain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/mach-omap2/powerdomain.c +0
-0@@ -128,7 +128,8 @@ skip_voltdm:for (i =0 ; i < pwrdm->banks; i++) pwrdm->ret_mem_off_counter[i] =0 ;
Quoted 8 lines
arch/arm/mach-omap2/powerdomain.c skip_voltdm: · line 135
Quoted 7 lines
arch/arm/mach-omap2/powerdomain.c +2
-1- arch_pwrdm->pwrdm_wait_transition (pwrdm); +if (arch_pwrdm && arch_pwrdm->pwrdm_wait_transition) + arch_pwrdm->pwrdm_wait_transition (pwrdm); pwrdm->state =pwrdm_read_pwrst (pwrdm); pwrdm->state_counter[pwrdm->state] =1 ;Acked-by Nishanth Menon <[email protected]>
I'll queue this into omap-for-v3.13/fixes-take4.
Regards,
Tony