From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Fri, 13 May 2011 08:08:51 -0700 Subject: kernel BUG while reading from SPI into static buffer In-Reply-To: References: Message-ID: <20110513150851.GA13400@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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