Re: [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure

2021-03-24 Thread Connor Kuehl
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]

[PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure

2021-03-24 Thread zhouchuangao
Allocate memory for struct fuse_conn may fail, we should not jump to out_err to kfree(fc). Signed-off-by: zhouchuangao --- fs/fuse/virtio_fs.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 4ee6f73..1f333c6 100644 ---