Commit 30df94f8 authored by Jeff Hansen's avatar Jeff Hansen Committed by David S. Miller

bridge: Fix double-free in br_add_if.

There is a potential double-kfree in net/bridge/br_if.c.  If br_fdb_insert
fails, then the kobject is put back (which calls kfree due to the kobject
release), and then kfree is called again on the net_bridge_port.  This
patch fixes the crash.

Thanks to Stephen Hemminger for the one-line fix.
Signed-off-by: default avatarJeff Hansen <x@jeffhansen.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8823ad31
......@@ -432,6 +432,7 @@ err2:
br_fdb_delete_by_port(br, p, 1);
err1:
kobject_put(&p->kobj);
p = NULL; /* kobject_put frees */
err0:
dev_set_promiscuity(dev, -1);
put_back:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment