kernel BUG while reading from SPI into static buffer

Greg KH greg at kroah.com
Fri May 13 11:08:51 EDT 2011


On Fri, May 13, 2011 at 12:33:15PM +0530, Felix Varghese wrote:
> Hi,
> 
> I am trying to read some data via SPI on an a modified (custom SPI device
> attached) AT91SAM9G20-EK board. If I pass a local array buffer, declared as
> "char buffer[100];" as the rx_buf pointer for the spi transfer, the code works
> fine. But if I just change the declaration to "static char buffer[100]"
> instead, I get the following crash:

Don't statically allocate memory for spi, you need to dynamically
allocate it with 'kmalloc'.

The fact that the first time didn't crash for you was just lucky.

hope this helps,

greg k-h



More information about the Kernelnewbies mailing list