diff options
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/conv.c | 2 | ||||
-rw-r--r-- | net/9p/mux.c | 9 | ||||
-rw-r--r-- | net/9p/sysctl.c | 21 |
3 files changed, 16 insertions, 16 deletions
diff --git a/net/9p/conv.c b/net/9p/conv.c index 37451178e76..d979d958ea1 100644 --- a/net/9p/conv.c +++ b/net/9p/conv.c @@ -763,6 +763,7 @@ struct p9_fcall *p9_create_twrite(u32 fid, u64 offset, u32 count, if (err) { kfree(fc); fc = ERR_PTR(err); + goto error; } if (buf_check_overflow(bufp)) { @@ -795,6 +796,7 @@ struct p9_fcall *p9_create_twrite_u(u32 fid, u64 offset, u32 count, if (err) { kfree(fc); fc = ERR_PTR(err); + goto error; } if (buf_check_overflow(bufp)) { diff --git a/net/9p/mux.c b/net/9p/mux.c index acb038810f3..5d70558c4c6 100644 --- a/net/9p/mux.c +++ b/net/9p/mux.c @@ -288,9 +288,10 @@ struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize, m->extended = extended; m->trans = trans; m->tagpool = p9_idpool_create(); - if (!m->tagpool) { + if (IS_ERR(m->tagpool)) { + mtmp = ERR_PTR(-ENOMEM); kfree(m); - return ERR_PTR(PTR_ERR(m->tagpool)); + return mtmp; } m->err = 0; @@ -308,8 +309,10 @@ struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize, memset(&m->poll_waddr, 0, sizeof(m->poll_waddr)); m->poll_task = NULL; n = p9_mux_poll_start(m); - if (n) + if (n) { + kfree(m); return ERR_PTR(n); + } n = trans->poll(trans, &m->pt); if (n & POLLIN) { diff --git a/net/9p/sysctl.c b/net/9p/sysctl.c index e7fe706ab95..8b61027a24e 100644 --- a/net/9p/sysctl.c +++ b/net/9p/sysctl.c @@ -28,15 +28,10 @@ #include <linux/init.h> #include <net/9p/9p.h> -enum { - P9_SYSCTL_NET = 487, - P9_SYSCTL_DEBUG = 1, -}; - -static ctl_table p9_table[] = { +static struct ctl_table p9_table[] = { #ifdef CONFIG_NET_9P_DEBUG { - .ctl_name = P9_SYSCTL_DEBUG, + .ctl_name = CTL_UNNUMBERED, .procname = "debug", .data = &p9_debug_level, .maxlen = sizeof(int), @@ -44,21 +39,21 @@ static ctl_table p9_table[] = { .proc_handler = &proc_dointvec }, #endif - { .ctl_name = 0 }, + {}, }; -static ctl_table p9_net_table[] = { +static struct ctl_table p9_net_table[] = { { - .ctl_name = P9_SYSCTL_NET, + .ctl_name = CTL_UNNUMBERED, .procname = "9p", .maxlen = 0, .mode = 0555, .child = p9_table, }, - { .ctl_name = 0 }, + {}, }; -static ctl_table p9_ctl_table[] = { +static struct ctl_table p9_ctl_table[] = { { .ctl_name = CTL_NET, .procname = "net", @@ -66,7 +61,7 @@ static ctl_table p9_ctl_table[] = { .mode = 0555, .child = p9_net_table, }, - { .ctl_name = 0 }, + {}, }; static struct ctl_table_header *p9_table_header; |