diff options
-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 44547201f5bc..5ad3a3bd73b2 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, | |||
451 | unsigned char **pdata) | 451 | unsigned char **pdata) |
452 | { | 452 | { |
453 | *pdata = buf_alloc(bufp, count); | 453 | *pdata = buf_alloc(bufp, count); |
454 | if (*pdata == NULL) | ||
455 | return -ENOMEM; | ||
454 | memmove(*pdata, data, count); | 456 | memmove(*pdata, data, count); |
455 | return count; | 457 | return 0; |
456 | } | 458 | } |
457 | 459 | ||
458 | static int | 460 | static int |
@@ -460,6 +462,8 @@ p9_put_user_data(struct cbuf *bufp, const char __user *data, int count, | |||
460 | unsigned char **pdata) | 462 | unsigned char **pdata) |
461 | { | 463 | { |
462 | *pdata = buf_alloc(bufp, count); | 464 | *pdata = buf_alloc(bufp, count); |
465 | if (*pdata == NULL) | ||
466 | return -ENOMEM; | ||
463 | return copy_from_user(*pdata, data, count); | 467 | return copy_from_user(*pdata, data, count); |
464 | } | 468 | } |
465 | 469 | ||