summaryrefslogtreecommitdiff
path: root/package/switch/src/switch-robo.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-01-28 13:52:37 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2012-01-28 13:52:37 +0000
commitb9da4dcb6b755568d7728d9e90feaad686b0b8c0 (patch)
treedc557d368fd2d0f42545800954e8c0604cb54123 /package/switch/src/switch-robo.c
parenteeb00634a7715204481a5fd83664a697e414bbfd (diff)
downloadmtk-20170518-b9da4dcb6b755568d7728d9e90feaad686b0b8c0.zip
mtk-20170518-b9da4dcb6b755568d7728d9e90feaad686b0b8c0.tar.gz
mtk-20170518-b9da4dcb6b755568d7728d9e90feaad686b0b8c0.tar.bz2
switch: fix some memory leaks in switch_parse_vlan()
SVN-Revision: 29936
Diffstat (limited to 'package/switch/src/switch-robo.c')
-rw-r--r--package/switch/src/switch-robo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/package/switch/src/switch-robo.c b/package/switch/src/switch-robo.c
index ec9e337..7bac919 100644
--- a/package/switch/src/switch-robo.c
+++ b/package/switch/src/switch-robo.c
@@ -459,6 +459,7 @@ static int handle_vlan_port_write(void *driver, char *buf, int nr)
robo_write32(ROBO_ARLIO_PAGE, 0x63 + regoff, (c->untag << 9) | c->port);
robo_write16(ROBO_ARLIO_PAGE, 0x61 + regoff, nr);
robo_write16(ROBO_ARLIO_PAGE, 0x60 + regoff, 1 << 7);
+ kfree(c);
return 0;
}
@@ -473,6 +474,7 @@ static int handle_vlan_port_write(void *driver, char *buf, int nr)
robo_write16(ROBO_VLAN_PAGE, ROBO_VLAN_TABLE_ACCESS, val16);
}
+ kfree(c);
return 0;
}
@@ -520,13 +522,9 @@ static int handle_enable_vlan_write(void *driver, char *buf, int nr)
static int handle_reset(void *driver, char *buf, int nr)
{
switch_driver *d = (switch_driver *) driver;
- switch_vlan_config *c = switch_parse_vlan(d, buf);
int j;
__u16 val16;
- if (c == NULL)
- return -EINVAL;
-
/* disable switching */
set_switch(0);