Re: oops when adding bridge interface, using v2.5.45

romieu
2002-11-10T23:02:23Z

Bart De Schuymer <bdschuym@pandora.be> :
[...]
> net/bridge/br_if.c::new_nbp() does
> p = kmalloc(sizeof(*p), GFP_KERNEL);
> which triggers the oops through mm/slab.c::kmem_flagcheck()
> I don't know what is wrong (I have no such problems with 2.4).
>
> The trace is below:
[sleeping function called with lock held]

[net/bridge/br_if.c:236]
write_lock_bh(&br->lock);
if ((p = new_nbp(br, dev)) == NULL) {
write_unlock_bh(&br->lock);

Following patch should fix it. It looks the same in 2.5.46.

--- net/bridge/br_if.c Sun Nov 10 23:57:28 2002
+++ net/bridge/br_if.c Sun Nov 10 23:57:57 2002
@@ -143,7 +143,7 @@ static struct net_bridge_port *new_nbp(s
int i;
struct net_bridge_port *p;

- p = kmalloc(sizeof(*p), GFP_KERNEL);
+ p = kmalloc(sizeof(*p), GFP_ATOMIC);
if (p == NULL)
return p;

--
Ueimor