From: Xiaotian Feng Date: Thu, 23 Jul 2009 23:06:32 +0000 (+0000) Subject: net/bridge: use kobject_put to release kobject in br_add_if error path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c587aea951a56d29741a3cef4ea3e142c93b3207;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net/bridge: use kobject_put to release kobject in br_add_if error path kobject_init_and_add will alloc memory for kobj->name, so in br_add_if error path, simply use kobject_del will not free memory for kobj->name. Fix by using kobject_put instead, kobject_put will internally calls kobject_del and frees memory for kobj->name. Signed-off-by: Xiaotian Feng Acked-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 8a96672e2c5c..eb404dc3ed6e 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -424,7 +424,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) err2: br_fdb_delete_by_port(br, p, 1); err1: - kobject_del(&p->kobj); + kobject_put(&p->kobj); err0: dev_set_promiscuity(dev, -1); put_back: