aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpiaojun <[email protected]>2018-07-11 08:43:49 +0800
committerDominique Martinet <[email protected]>2018-08-13 09:21:44 +0900
commitb87d1d26521ef9f2e42bb182184d1427b4e07b26 (patch)
treeae0a00a53c298b9a159fe76efc024a501493e925
parent64ad31f3284060d59850da6d573ddbab542365cf (diff)
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/[email protected] Signed-off-by: Jun Piao <[email protected]> Reviewed-by: Yiwen Jiang <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Cc: Eric Van Hensbergen <[email protected]> Cc: Ron Minnich <[email protected]> Cc: Latchesar Ionkov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Dominique Martinet <[email protected]>
-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)) {