From: jiangyiwen <jiangyiwen@huawei.com>
To: piaojun <piaojun@huawei.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
<ericvh@gmail.com>, <rminnich@sandia.gov>, <lucho@ionkov.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
<v9fs-developer@lists.sourceforge.net>
Subject: Re: [PATCH] 9p/net/protocol.c: return -ENOMEM when kmalloc() failed
Date: Wed, 11 Jul 2018 09:25:27 +0800 [thread overview]
Message-ID: <5B455C87.6090507@huawei.com> (raw)
In-Reply-To: <5B4552C5.60000@huawei.com>
On 2018/7/11 8:43, piaojun wrote:
> We should return -ENOMEM to upper user when kmalloc failed to indicate
> accurate errno.
>
> Signed-off-by: Jun Piao <piaojun@huawei.com>
Reviewed-by: Yiwen Jiang <jiangyiwen@huawei.com>
> ---
> net/9p/protocol.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/9p/protocol.c b/net/9p/protocol.c
> index 931ea00..4a1e1dd 100644
> --- a/net/9p/protocol.c
> +++ b/net/9p/protocol.c
> @@ -156,7 +156,7 @@ static size_t pdu_write(struct p9_fcall *pdu, const void *data, size_t size)
>
> *sptr = kmalloc(len + 1, GFP_NOFS);
> if (*sptr == NULL) {
> - errcode = -EFAULT;
> + errcode = -ENOMEM;
> break;
> }
> if (pdu_read(pdu, *sptr, len)) {
>
prev parent reply other threads:[~2018-07-11 1:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 0:43 [PATCH] 9p/net/protocol.c: return -ENOMEM when kmalloc() failed piaojun
2018-07-11 1:25 ` jiangyiwen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B455C87.6090507@huawei.com \
--to=jiangyiwen@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=piaojun@huawei.com \
--cc=rminnich@sandia.gov \
--cc=v9fs-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.