[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <85ce5bf1-810d-4a7b-a465-e25aa34f719b@kili.mountain>
Date: Wed, 19 Apr 2023 14:23:16 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: yingsha xu <ysxu@...t.edu.cn>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Jiri Benc <jbenc@...e.cz>,
"John W. Linville" <linville@...driver.com>,
hust-os-kernel-patches@...glegroups.com,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: mac80211: use IS_ERR to check return value
On Tue, Apr 18, 2023 at 10:36:14AM +0200, Johannes Berg wrote:
> On Sun, 2023-04-16 at 16:30 +0800, yingsha xu wrote:
> > According to the annotation of function debugfs_create_fs, if
> > an error occurs, ERR_PTR(-ERROR) will be returned instead of
> > a null pointer or zero value.
> >
> > Fix it by using IS_ERR().
>
> I don't this this is right, or fixed anything ...
>
> If debugfs indeed returned an ERR_PTR() value, then the later debugfs
> adds will do nothing.
>
> Since it doesn't look like debugfs_create_dir() can actually return NULL
> these days (not sure it ever could), I guess we can even remove the
> check.
>
Correct. They have a patch ready which deletes the check and the
comment. Someone should have replied to this thread to NAK their own
patch so that you didn't bother reviewing it.
> But you could've just read the comment there too, to know what the NULL
> check was about ...
The comment was always wrong. Debugfs could return NULL but then
the other debugfs functions turned into no ops...
regards,
dan carpenter
Powered by blists - more mailing lists