title: kernel crash with kmalloc
body: <p>I am trying to assign memory using <code>kmalloc</code> in kernel code in fact in a queueing discipline. I want to assign memory to <code>q-&gt;agg_queue_hdr</code> of which <code>q</code> is a queueing discipline and <code>agg_queue_hdr</code> is a struct, so if assign memory like this: </p>
  
  <pre><code>q-&gt;agg_queue_hdr=kmalloc(sizeof(struct agg_queue), GFP_ATOMIC);
  </code></pre>
  
  <p>the kernel crashes. Based on the examples of <code>kmalloc</code> I saw from searching, I now changed it to:</p>
  
  <pre><code>agg_queue_hdr=kmalloc(sizeof(struct agg_queue), GFP_ATOMIC);
  </code></pre>
  
  <p>with which the kernel doesn't crash. Now I want to know how can I assign memory to the pointer <code>q-&gt;agg_queue_hdr</code>?</p>