Menu

#4 fib_add_vrf

open
nobody
linux-vrf (2)
5
2003-10-14
2003-10-14
Yao Zhao
No

int
fib_add_vrf (unsigned char vrf)
{
struct fib_rule *df_rule;
struct fib_rule *main_rule;
struct fib_rule *loc_rule;

if (fib_rules[vrf])
return -EEXIST;
if (vrf)
write_lock_bh (&fib_rules_lock[vrf]);

df_rule = kmalloc (sizeof (struct fib_rule), GFP_KERNEL);
main_rule = kmalloc (sizeof (struct fib_rule),
GFP_KERNEL);
loc_rule = kmalloc (sizeof (struct fib_rule),
GFP_KERNEL);

......
}

write_lock_bh will make in_interrupt true.
so sometimes use kmalloc(,GFP_KERNEL) will cause BUG.
so i think move it out of write_lock_bh.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.