I am trying to assign memory using kmalloc
in kernel code in fact in a queueing discipline. I want to assign memory to q->agg_queue_hdr
of which q
is a queueing discipline and agg_queue_hdr
is a struct, so if assign memory like this:
q->agg_queue_hdr=kmalloc(sizeof(struct agg_queue), GFP_ATOMIC);
the kernel crashes. Based on the examples of kmalloc
I saw from searching, I now changed it to:
agg_queue_hdr=kmalloc(sizeof(struct agg_queue), GFP_ATOMIC);
with which the kernel doesn't crash. Now I want to know how can I assign memory to the pointer q->agg_queue_hdr
?
struct aggregate_sched_data *q = qdisc_priv(sch); // this struct is defined as follows
– docas Oct 05 '11 at 13:10struct aggregate_sched_data { struct qdisc_watchdog watchdog; unsigned int agg_min_size; unsigned int agg_max_size; unsigned int agg_max_timeout; struct agg_queue *agg_queue_hdr; };