aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/um/drivers/daemon_user.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/um/drivers/daemon_user.c b/arch/um/drivers/daemon_user.c
index c1b03f7c1daa..1bb085b2824d 100644
--- a/arch/um/drivers/daemon_user.c
+++ b/arch/um/drivers/daemon_user.c
@@ -98,7 +98,7 @@ static int connect_to_switch(struct daemon_data *pri)
98 printk("daemon_open : control setup request failed, err = %d\n", 98 printk("daemon_open : control setup request failed, err = %d\n",
99 -n); 99 -n);
100 err = -ENOTCONN; 100 err = -ENOTCONN;
101 goto out; 101 goto out_free;
102 } 102 }
103 103
104 n = os_read_file(pri->control, sun, sizeof(*sun)); 104 n = os_read_file(pri->control, sun, sizeof(*sun));
@@ -106,12 +106,14 @@ static int connect_to_switch(struct daemon_data *pri)
106 printk("daemon_open : read of data socket failed, err = %d\n", 106 printk("daemon_open : read of data socket failed, err = %d\n",
107 -n); 107 -n);
108 err = -ENOTCONN; 108 err = -ENOTCONN;
109 goto out_close; 109 goto out_free;
110 } 110 }
111 111
112 pri->data_addr = sun; 112 pri->data_addr = sun;
113 return(fd); 113 return(fd);
114 114
115 out_free:
116 kfree(sun);
115 out_close: 117 out_close:
116 os_close_file(fd); 118 os_close_file(fd);
117 out: 119 out: