summaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorpiaojun <piaojun@huawei.com>2018-07-11 02:43:49 +0200
committerDominique Martinet <dominique.martinet@cea.fr>2018-08-13 02:21:44 +0200
commitb87d1d26521ef9f2e42bb182184d1427b4e07b26 (patch)
treeae0a00a53c298b9a159fe76efc024a501493e925 /net/9p
parentnet/9p/client.c: add missing '\n' at the end of p9_debug() (diff)
downloadlinux-b87d1d26521ef9f2e42bb182184d1427b4e07b26.tar.xz
linux-b87d1d26521ef9f2e42bb182184d1427b4e07b26.zip
9p/net/protocol.c: return -ENOMEM when kmalloc() failed
We should return -ENOMEM to upper user when kmalloc failed to indicate accurate errno. Link: http://lkml.kernel.org/r/5B4552C5.60000@huawei.com Signed-off-by: Jun Piao <piaojun@huawei.com> Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Ron Minnich <rminnich@sandia.gov> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/protocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 931ea00c4fed..4a1e1dd30b52 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -156,7 +156,7 @@ p9pdu_vreadf(struct p9_fcall *pdu, int proto_version, const char *fmt,
*sptr = kmalloc(len + 1, GFP_NOFS);
if (*sptr == NULL) {
- errcode = -EFAULT;
+ errcode = -ENOMEM;
break;
}
if (pdu_read(pdu, *sptr, len)) {