Re: [PATCH 1/1] omap: Ptr "isr_reg" tracked as NULL was dereferenced

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Evgeny Kuznetsov
Date: Tuesday, October 5, 2010 - 11:33 pm

On Tue, 2010-10-05 at 08:01 -0700, ext Kevin Hilman wrote:

'isr_reg' is dereferenced later in code:
	...
	isr_saved = isr = __raw_readl(isr_reg) & enabled;
	...
So this will stop kernel anyway.
I just hoped to help in understanding of issue by log line. WARN_ON
could be used for this.

As a variant compilation error could be added, to prevent situation when
kernel is incorrectly configured.
E.g.:
#if !defined(CONFIG_ARCH_OMAP1) &&		
	!defined(CONFIG_ARCH_OMAP15XX) &&	
	!defined(CONFIG_ARCH_OMAP16XX) &&	
	!defined(CONFIG_ARCH_OMAP730) &&	
	!defined(CONFIG_ARCH_OMAP850) &&	
	!defined(CONFIG_ARCH_OMAP2) &&	
	!defined(CONFIG_ARCH_OMAP3) &&	
	!defined(CONFIG_ARCH_OMAP4)

#error "Incorrect arch configuration"
#endif

But there are still cases when 'isr_reg' could have NULL value (if
'bank->method' is not equal to configured one).

Regards,
Evgeny



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/1] omap: Ptr "isr_reg" tracked as NULL was de ..., Evgeny Kuznetsov, (Tue Oct 5, 11:33 pm)