author | Eric Van Hensbergen
<ericvh@ericvh-desktop.austin.ibm.com> 2008-09-24 21:22:22 UTC |
committer | Eric Van Hensbergen
<ericvh@ericvh-desktop.austin.ibm.com> 2008-09-24 21:22:22 UTC |
parent | 62aa528e0299ffef8e138d9d92d13e631d06c5ff |
net/9p/conv.c | +5 | -1 |
diff --git a/net/9p/conv.c b/net/9p/conv.c index 44547201f5b..5ad3a3bd73b 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); }