[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54b353b6-949d-45a1-896d-bb5acb2ed4ed@web.de>
Date: Fri, 29 Dec 2023 10:10:08 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Matthew Wilcox <willy@...radead.org>, virtualization@...ts.linux.dev,
linux-fsdevel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, Miklos Szeredi <miklos@...redi.hu>,
Stefan Hajnoczi <stefanha@...hat.com>, Vivek Goyal <vgoyal@...hat.com>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] virtiofs: Improve error handling in
virtio_fs_get_tree()
>> The kfree() function was called in two cases by
>> the virtio_fs_get_tree() function during error handling
>> even if the passed variable contained a null pointer.
>
> So what? kfree(NULL) is perfectly acceptable.
I suggest to reconsider the usefulness of such a special function call.
> Are you trying to optimise an error path?
I would appreciate if further improvements can be achieved.
https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources
Regards,
Markus
Powered by blists - more mailing lists