aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_basic.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_basic.c')
-rw-r--r--net/sched/cls_basic.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c
index dfb300bb6baa..09fda68c8b39 100644
--- a/net/sched/cls_basic.c
+++ b/net/sched/cls_basic.c
@@ -9,7 +9,6 @@
9 * Authors: Thomas Graf <tgraf@suug.ch> 9 * Authors: Thomas Graf <tgraf@suug.ch>
10 */ 10 */
11 11
12#include <linux/config.h>
13#include <linux/module.h> 12#include <linux/module.h>
14#include <linux/types.h> 13#include <linux/types.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
@@ -179,25 +178,23 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle,
179 178
180 err = -ENOBUFS; 179 err = -ENOBUFS;
181 if (head == NULL) { 180 if (head == NULL) {
182 head = kmalloc(sizeof(*head), GFP_KERNEL); 181 head = kzalloc(sizeof(*head), GFP_KERNEL);
183 if (head == NULL) 182 if (head == NULL)
184 goto errout; 183 goto errout;
185 184
186 memset(head, 0, sizeof(*head));
187 INIT_LIST_HEAD(&head->flist); 185 INIT_LIST_HEAD(&head->flist);
188 tp->root = head; 186 tp->root = head;
189 } 187 }
190 188
191 f = kmalloc(sizeof(*f), GFP_KERNEL); 189 f = kzalloc(sizeof(*f), GFP_KERNEL);
192 if (f == NULL) 190 if (f == NULL)
193 goto errout; 191 goto errout;
194 memset(f, 0, sizeof(*f));
195 192
196 err = -EINVAL; 193 err = -EINVAL;
197 if (handle) 194 if (handle)
198 f->handle = handle; 195 f->handle = handle;
199 else { 196 else {
200 int i = 0x80000000; 197 unsigned int i = 0x80000000;
201 do { 198 do {
202 if (++head->hgenerator == 0x7FFFFFFF) 199 if (++head->hgenerator == 0x7FFFFFFF)
203 head->hgenerator = 1; 200 head->hgenerator = 1;