title: Bus error in memory read/write operation
body: <p>I hav written a kernel program for memory read/write operation.</p>
  
  <pre><code>#include&lt;linux/kernel.h&gt;
  #include&lt;linux/module.h&gt;
  #include&lt;linux/init.h&gt;
  #include&lt;linux/io.h&gt;
  
  static uint32_t *mem_alloc(void)
  {
     uint32_t *base, *mem;
     base=kmalloc(5*sizeof(uint32_t),GFP_KERNEL);
     mem=ioremap(base,5*sizeof(uint32_t));
     return(mem);
  }
  
  static void mem_write(uint32_t *memory)
  {
    uint32_t *mem1;
    mem1=memory;
    int i;
    for(i=0;i&lt;5;i++)
    {
      *mem1=0x1010F0F0;
      mem1++;
    }
  }
  
  static int __init insert(void)
  {
    uint32_t *memory;
    memory=mem_alloc();
    mem_write(memory);
    return 0;
  }
  
  static void __exit remove(uint32_t *memory)
  {
    kfree(memory);
  }
  </code></pre>
  
  <p>in this program a bus error occurs when executing the instruction</p>
  
  <pre><code> *mem1=0x1010F0F0;
  </code></pre>