From 3165ea7886d40115fc382c3271495abc67d12fed Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sun, 13 Jun 2010 11:37:32 +0000 Subject: [PATCH] swconfig: release switch in error path of swconfig_get_attr Signed-off-by: Karl Beldan SVN-Revision: 21779 --- target/linux/generic-2.6/files/drivers/net/phy/swconfig.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c index bda2e2d619d0..fa916982f089 100644 --- a/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic-2.6/files/drivers/net/phy/swconfig.c @@ -688,7 +688,7 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info) memset(&val, 0, sizeof(val)); attr = swconfig_lookup_attr(dev, info, &val); if (!attr || !attr->get) - goto error_dev; + goto error; if (attr->type == SWITCH_TYPE_PORTS) { val.value.ports = dev->portbuf; @@ -737,9 +737,8 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info) nla_put_failure: if (msg) nlmsg_free(msg); -error_dev: - swconfig_put_dev(dev); error: + swconfig_put_dev(dev); if (!err) err = -ENOMEM; return err; -- 2.30.2