diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2006-07-13 07:10:48 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-19 13:50:39 -0400 |
commit | 15880352659a363209c5ad9cfc796a9c8a7f5196 (patch) | |
tree | 122365b897cff1dd81ee5d372c7c9360620097f7 /drivers/net/slhc.c | |
parent | b6e37e55c250f5233401b2566b1a4b512a98bc7b (diff) |
[PATCH] Convert to kzalloc
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/slhc.c')
-rw-r--r-- | drivers/net/slhc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 3a1b7131681c..f0adad520af2 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c | |||
@@ -94,27 +94,24 @@ slhc_init(int rslots, int tslots) | |||
94 | register struct cstate *ts; | 94 | register struct cstate *ts; |
95 | struct slcompress *comp; | 95 | struct slcompress *comp; |
96 | 96 | ||
97 | comp = (struct slcompress *)kmalloc(sizeof(struct slcompress), | 97 | comp = (struct slcompress *)kzalloc(sizeof(struct slcompress), |
98 | GFP_KERNEL); | 98 | GFP_KERNEL); |
99 | if (! comp) | 99 | if (! comp) |
100 | goto out_fail; | 100 | goto out_fail; |
101 | memset(comp, 0, sizeof(struct slcompress)); | ||
102 | 101 | ||
103 | if ( rslots > 0 && rslots < 256 ) { | 102 | if ( rslots > 0 && rslots < 256 ) { |
104 | size_t rsize = rslots * sizeof(struct cstate); | 103 | size_t rsize = rslots * sizeof(struct cstate); |
105 | comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL); | 104 | comp->rstate = (struct cstate *) kzalloc(rsize, GFP_KERNEL); |
106 | if (! comp->rstate) | 105 | if (! comp->rstate) |
107 | goto out_free; | 106 | goto out_free; |
108 | memset(comp->rstate, 0, rsize); | ||
109 | comp->rslot_limit = rslots - 1; | 107 | comp->rslot_limit = rslots - 1; |
110 | } | 108 | } |
111 | 109 | ||
112 | if ( tslots > 0 && tslots < 256 ) { | 110 | if ( tslots > 0 && tslots < 256 ) { |
113 | size_t tsize = tslots * sizeof(struct cstate); | 111 | size_t tsize = tslots * sizeof(struct cstate); |
114 | comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL); | 112 | comp->tstate = (struct cstate *) kzalloc(tsize, GFP_KERNEL); |
115 | if (! comp->tstate) | 113 | if (! comp->tstate) |
116 | goto out_free2; | 114 | goto out_free2; |
117 | memset(comp->tstate, 0, tsize); | ||
118 | comp->tslot_limit = tslots - 1; | 115 | comp->tslot_limit = tslots - 1; |
119 | } | 116 | } |
120 | 117 | ||