From: Connor Kuehl <ckuehl@redhat.com>
To: zhouchuangao <zhouchuangao@vivo.com>,
Vivek Goyal <vgoyal@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Miklos Szeredi <miklos@szeredi.hu>,
virtualization@lists.linux-foundation.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure
Date: Wed, 24 Mar 2021 08:58:26 -0500 [thread overview]
Message-ID: <7dbe66b5-344b-2008-ca8f-559a271a061f@redhat.com> (raw)
In-Reply-To: <1616589523-32024-1-git-send-email-zhouchuangao@vivo.com>
On 3/24/21 7:38 AM, zhouchuangao wrote:
> Allocate memory for struct fuse_conn may fail, we should not jump to
> out_err to kfree(fc).
Why not? If fc's allocation fails then it is NULL and calling kfree() on
a NULL pointer is a noop[1].
Connor
[1]
https://www.kernel.org/doc/html/latest/core-api/mm-api.html?highlight=kfree#c.kfree
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
parent reply other threads:[~2021-03-24 13:58 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1616589523-32024-1-git-send-email-zhouchuangao@vivo.com>]
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=7dbe66b5-344b-2008-ca8f-559a271a061f@redhat.com \
--to=ckuehl@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=stefanha@redhat.com \
--cc=vgoyal@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=zhouchuangao@vivo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).