lkml.org 
[lkml]   [2021]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] fs/fuse/virtio_fs: Fix a potential memory allocation failure
From
Date
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

\
 
 \ /
  Last update: 2021-03-24 15:02    [W:3.050 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site