diff options
Diffstat (limited to 'drivers/net/slhc.c')
-rw-r--r-- | drivers/net/slhc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index f0adad520af2..24bbe00852b2 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c | |||
@@ -94,14 +94,13 @@ 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 *)kzalloc(sizeof(struct slcompress), | 97 | comp = kzalloc(sizeof(struct slcompress), GFP_KERNEL); |
98 | GFP_KERNEL); | ||
99 | if (! comp) | 98 | if (! comp) |
100 | goto out_fail; | 99 | goto out_fail; |
101 | 100 | ||
102 | if ( rslots > 0 && rslots < 256 ) { | 101 | if ( rslots > 0 && rslots < 256 ) { |
103 | size_t rsize = rslots * sizeof(struct cstate); | 102 | size_t rsize = rslots * sizeof(struct cstate); |
104 | comp->rstate = (struct cstate *) kzalloc(rsize, GFP_KERNEL); | 103 | comp->rstate = kzalloc(rsize, GFP_KERNEL); |
105 | if (! comp->rstate) | 104 | if (! comp->rstate) |
106 | goto out_free; | 105 | goto out_free; |
107 | comp->rslot_limit = rslots - 1; | 106 | comp->rslot_limit = rslots - 1; |
@@ -109,7 +108,7 @@ slhc_init(int rslots, int tslots) | |||
109 | 108 | ||
110 | if ( tslots > 0 && tslots < 256 ) { | 109 | if ( tslots > 0 && tslots < 256 ) { |
111 | size_t tsize = tslots * sizeof(struct cstate); | 110 | size_t tsize = tslots * sizeof(struct cstate); |
112 | comp->tstate = (struct cstate *) kzalloc(tsize, GFP_KERNEL); | 111 | comp->tstate = kzalloc(tsize, GFP_KERNEL); |
113 | if (! comp->tstate) | 112 | if (! comp->tstate) |
114 | goto out_free2; | 113 | goto out_free2; |
115 | comp->tslot_limit = tslots - 1; | 114 | comp->tslot_limit = tslots - 1; |
@@ -138,9 +137,9 @@ slhc_init(int rslots, int tslots) | |||
138 | return comp; | 137 | return comp; |
139 | 138 | ||
140 | out_free2: | 139 | out_free2: |
141 | kfree((unsigned char *)comp->rstate); | 140 | kfree(comp->rstate); |
142 | out_free: | 141 | out_free: |
143 | kfree((unsigned char *)comp); | 142 | kfree(comp); |
144 | out_fail: | 143 | out_fail: |
145 | return NULL; | 144 | return NULL; |
146 | } | 145 | } |