1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-25 08:13:20 +02:00

backfire: swconfig: release switch in error path of swconfig_get_attr (backport of r21799)

Signed-off-by: Karl Beldan <karl.beldan@sagemcom.com>


git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@21781 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg 2010-06-13 11:45:40 +00:00
parent cb8ef04009
commit 87adaa5f56

View File

@ -684,7 +684,7 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info)
memset(&val, 0, sizeof(val)); memset(&val, 0, sizeof(val));
attr = swconfig_lookup_attr(dev, info, &val); attr = swconfig_lookup_attr(dev, info, &val);
if (!attr || !attr->get) if (!attr || !attr->get)
goto error_dev; goto error;
if (attr->type == SWITCH_TYPE_PORTS) { if (attr->type == SWITCH_TYPE_PORTS) {
val.value.ports = dev->portbuf; val.value.ports = dev->portbuf;
@ -733,9 +733,8 @@ swconfig_get_attr(struct sk_buff *skb, struct genl_info *info)
nla_put_failure: nla_put_failure:
if (msg) if (msg)
nlmsg_free(msg); nlmsg_free(msg);
error_dev:
swconfig_put_dev(dev);
error: error:
swconfig_put_dev(dev);
if (!err) if (!err)
err = -ENOMEM; err = -ENOMEM;
return err; return err;