diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-24 22:33:50 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-24 22:33:50 (GMT) |
commit | 7a528159b93bc52c14aedff55d53e741227fc846 (patch) | |
tree | 742e5b26440ef2c253d543a2b0a4bed8d3496f1e /net/9p/conv.c | |
parent | fb478da5ba69ecf40729ae8ab37ca406b1e5be48 (diff) | |
parent | 16ec4700127d479143c77fd9128dfa17ab572963 (diff) | |
download | linux-fsl-qoriq-7a528159b93bc52c14aedff55d53e741227fc846.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
9p: fix put_data error handling
9p: use an IS_ERR test rather than a NULL test
9p: introduce missing kfree
9p-trans_fd: fix and clean up module init/exit paths
9p-trans_fd: don't do fs segment mangling in p9_fd_poll()
9p-trans_fd: clean up p9_conn_create()
9p-trans_fd: fix trans_fd::p9_conn_destroy()
9p: implement proper trans module refcounting and unregistration
Diffstat (limited to 'net/9p/conv.c')
-rw-r--r-- | net/9p/conv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/9p/conv.c b/net/9p/conv.c index 4454720..5ad3a3b 100644 --- a/net/9p/conv.c +++ b/net/9p/conv.c @@ -451,8 +451,10 @@ p9_put_data(struct cbuf *bufp, const char *data, int count, unsigned char **pdata) { *pdata = buf_alloc(bufp, count); + if (*pdata == NULL) + return -ENOMEM; memmove(*pdata, data, count); - return count; + return 0; } static int @@ -460,6 +462,8 @@ p9_put_user_data(struct cbuf *bufp, const char __user *data, int count, unsigned char **pdata) { *pdata = buf_alloc(bufp, count); + if (*pdata == NULL) + return -ENOMEM; return copy_from_user(*pdata, data, count); } |