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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux