提交 ba260e23 编写于 作者: P Paolo 'Blaisorblade' Giarrusso 提交者: Linus Torvalds

[PATCH] uml: fix daemon transport exit path bug

Fix some exit path bugs in the daemon driver.
Signed-off-by: NPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: NJeff Dike <jdike@addtoit.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 7a590611
...@@ -98,7 +98,7 @@ static int connect_to_switch(struct daemon_data *pri) ...@@ -98,7 +98,7 @@ static int connect_to_switch(struct daemon_data *pri)
printk("daemon_open : control setup request failed, err = %d\n", printk("daemon_open : control setup request failed, err = %d\n",
-n); -n);
err = -ENOTCONN; err = -ENOTCONN;
goto out; goto out_free;
} }
n = os_read_file(pri->control, sun, sizeof(*sun)); n = os_read_file(pri->control, sun, sizeof(*sun));
...@@ -106,12 +106,14 @@ static int connect_to_switch(struct daemon_data *pri) ...@@ -106,12 +106,14 @@ static int connect_to_switch(struct daemon_data *pri)
printk("daemon_open : read of data socket failed, err = %d\n", printk("daemon_open : read of data socket failed, err = %d\n",
-n); -n);
err = -ENOTCONN; err = -ENOTCONN;
goto out_close; goto out_free;
} }
pri->data_addr = sun; pri->data_addr = sun;
return(fd); return(fd);
out_free:
kfree(sun);
out_close: out_close:
os_close_file(fd); os_close_file(fd);
out: out:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册