* [SLHC 2/4] Convert to kzalloc
@ 2006-07-13 11:10 Ralf Baechle
2006-07-13 17:08 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Ralf Baechle @ 2006-07-13 11:10 UTC (permalink / raw)
To: David S. Miller, netdev, Jeff Garzik
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
drivers/net/slhc.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Index: linux-net/drivers/net/slhc.c
===================================================================
--- linux-net.orig/drivers/net/slhc.c 2006-07-09 02:47:58.000000000 +0100
+++ linux-net/drivers/net/slhc.c 2006-07-10 01:35:51.000000000 +0100
@@ -94,27 +94,24 @@ slhc_init(int rslots, int tslots)
register struct cstate *ts;
struct slcompress *comp;
- comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
+ comp = (struct slcompress *)kzalloc(sizeof(struct slcompress),
GFP_KERNEL);
if (! comp)
goto out_fail;
- memset(comp, 0, sizeof(struct slcompress));
if ( rslots > 0 && rslots < 256 ) {
size_t rsize = rslots * sizeof(struct cstate);
- comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL);
+ comp->rstate = (struct cstate *) kzalloc(rsize, GFP_KERNEL);
if (! comp->rstate)
goto out_free;
- memset(comp->rstate, 0, rsize);
comp->rslot_limit = rslots - 1;
}
if ( tslots > 0 && tslots < 256 ) {
size_t tsize = tslots * sizeof(struct cstate);
- comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL);
+ comp->tstate = (struct cstate *) kzalloc(tsize, GFP_KERNEL);
if (! comp->tstate)
goto out_free2;
- memset(comp->tstate, 0, tsize);
comp->tslot_limit = tslots - 1;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-07-13 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-13 11:10 [SLHC 2/4] Convert to kzalloc Ralf Baechle
2006-07-13 17:08 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).