sch_atm.c-kzalloc
Subsystems (3)
PATCH 1/1 sch_atm.c-kzalloc
Replacing kmalloc/memset combination with kzalloc.
---
net/sched/sch_atm.c +1 -2
@@ -308,13 +308,12 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, } }DPRINTK ("atm_tc_change: new id %x\n" ,classid); - flow =kmalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL ); + flow =kzalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL );DPRINTK ("atm_tc_change: flow %p\n" ,flow);if (!flow) { error = -ENOBUFS ; goto err_out; } -memset (flow,0 ,sizeof (*flow)); flow->filter_list =NULL ;if (!(flow->q =qdisc_create_dflt (sch->dev,&pfifo_qdisc_ops,classid))) flow->q = &noop_qdisc;
Signature · 4 lines
Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
Quoted 7 lines · On 4/16/07, [email protected] <[email protected]> wrote:
Replacing kmalloc/memset combination with kzalloc.
net/sched/sch_atm.c +0
-0@@ -308,13 +308,12 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, }
net/sched/sch_atm.c static int atm_tc_change(struct Qdisc *sch, u32 · line 318
Quoted 10 lines
net/sched/sch_atm.c +1
-2}DPRINTK ("atm_tc_change: new id %x\n" ,classid); - flow =kmalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL ); + flow =kzalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL );DPRINTK ("atm_tc_change: flow %p\n" ,flow);if (!flow) { error = -ENOBUFS ; goto err_out; } -memset (flow,0 ,sizeof (*flow));
A change which change runtime behaviour.
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
2007/4/16, Alexey Dobriyan <[email protected]>:
Quoted 12 lines · On 4/16/07, [email protected] <[email protected]> wrote:
Quoted 11 lines
Replacing kmalloc/memset combination with kzalloc.
net/sched/sch_atm.c +1
-1@@ -308,13 +308,12 @@ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, } } DPRINTK("atm_tc_change: new id %x\n",classid); - flow =kmalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL ); + flow =kzalloc (sizeof (struct atm_flow_data )+hdr_len,GFP_KERNEL );
Quoted 8 lines
net/sched/sch_atm.c static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, · line 317
Quoted 6 lines
net/sched/sch_atm.c +0
-1DPRINTK ("atm_tc_change: flow %p\n" ,flow);if (!flow) { error = -ENOBUFS ; goto err_out; } -memset (flow,0 ,sizeof (*flow));A change which change runtime behaviour.
similar change happened in cfi_probe.c patch, but I don't think it's harmful...
_______________________________________________
Kernel-janitors mailing list [email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
On 4/16/07, Marcin Åšlusarz <[email protected]> wrote:> 2007/4/16, Alexey Dobriyan <[email protected]>:> > On 4/16/07, [email protected] <[email protected]> wrote:> > > Replacing kmalloc/memset combination with kzalloc.> >> > > --- a/net/sched/sch_atm.c> > > +++ b/net/sched/sch_atm.c> > > @@ -308,13 +308,12 @@ static int atm_tc_change(struct Qdisc *sch, u32> > > classid, u32 parent,> > > }> > > }> > > DPRINTK("atm_tc_change: new id %x\n",classid);> > > - flow = kmalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL);> > > + flow = kzalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL);
== Newbie Question ==What's the difference between the two kmalloc and the kzalloc calls? -- It's not much, but it's what I call 127.0.0.1
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
kzalloc performs a kmalloc and if the allocation is successful it continues to perform a memset 0.
Quoted 7 lines · Chris Miller
On 4/16/07, Marcin Ślusarz <[email protected]> wrote:> 2007/4/16, Alexey Dobriyan <[email protected]>:> > On 4/16/07, [email protected] <[email protected]> wrote:> > > Replacing kmalloc/memset combination with kzalloc.> >> > > ---
a/net/sched/sch_atm.c> > > +++b/net/sched/sch_atm.c> > > @@ -308,13 +308,12 @@ static int atm_tc_change(struct Qdisc *sch, u32> > > classid, u32 parent,> > > }> > > }> > >DPRINTK("atm_tc_change: new id %x\n",classid);> > > - flow =kmalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL);> > > + flow =kzalloc(sizeof(struct atm_flow_data)+hdr_len,GFP_KERNEL);
=== Newbie Question ===What's the difference between the two kmalloc and the kzalloc calls? -- It's not much, but it's what I call 127.0.0.1
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
Signature · 4 lines
Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
Quoted 2 lines · On 4/16/07, [email protected] <[email protected]> wrote:
kzalloc performs a kmalloc and if the allocation is successful it continues to perform a memset 0.
Ah, okay. :)
Signature · 5 lines
It's not much, but it's what I call 127.0.0.1 _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors