* Re: [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure [not found] <1616589523-32024-1-git-send-email-zhouchuangao@vivo.com> @ 2021-03-24 13:58 ` Connor Kuehl 0 siblings, 0 replies; only message in thread From: Connor Kuehl @ 2021-03-24 13:58 UTC (permalink / raw) To: zhouchuangao, Vivek Goyal, Stefan Hajnoczi, Miklos Szeredi, virtualization, linux-fsdevel, linux-kernel 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 ^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-03-24 13:58 UTC | newest] Thread overview: (only message) (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <1616589523-32024-1-git-send-email-zhouchuangao@vivo.com> 2021-03-24 13:58 ` [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure Connor Kuehl
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).