diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/mux.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/9p/mux.c b/net/9p/mux.c index acb038810f39..5d70558c4c61 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, | |||
288 | m->extended = extended; | 288 | m->extended = extended; |
289 | m->trans = trans; | 289 | m->trans = trans; |
290 | m->tagpool = p9_idpool_create(); | 290 | m->tagpool = p9_idpool_create(); |
291 | if (!m->tagpool) { | 291 | if (IS_ERR(m->tagpool)) { |
292 | mtmp = ERR_PTR(-ENOMEM); | ||
292 | kfree(m); | 293 | kfree(m); |
293 | return ERR_PTR(PTR_ERR(m->tagpool)); | 294 | return mtmp; |
294 | } | 295 | } |
295 | 296 | ||
296 | m->err = 0; | 297 | m->err = 0; |
@@ -308,8 +309,10 @@ struct p9_conn *p9_conn_create(struct p9_transport *trans, int msize, | |||
308 | memset(&m->poll_waddr, 0, sizeof(m->poll_waddr)); | 309 | memset(&m->poll_waddr, 0, sizeof(m->poll_waddr)); |
309 | m->poll_task = NULL; | 310 | m->poll_task = NULL; |
310 | n = p9_mux_poll_start(m); | 311 | n = p9_mux_poll_start(m); |
311 | if (n) | 312 | if (n) { |
313 | kfree(m); | ||
312 | return ERR_PTR(n); | 314 | return ERR_PTR(n); |
315 | } | ||
313 | 316 | ||
314 | n = trans->poll(trans, &m->pt); | 317 | n = trans->poll(trans, &m->pt); |
315 | if (n & POLLIN) { | 318 | if (n & POLLIN) { |