[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zsesertnqs_KhRd4@surfacebook.localdomain>
Date: Fri, 23 Aug 2024 00:24:10 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Yang Ruibin <11162571@...o.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
opensource.kernel@...o.com
Subject: Re: [PATCH v1] lib:Fix the NULL vs IS_ERR() bug for
debugfs_create_dir()
Wed, Aug 21, 2024 at 03:34:40AM -0400, Yang Ruibin kirjoitti:
> The debugfs_create_dir() function returns error pointers.
> It never returns NULL. So use IS_ERR() to check it.
> selftest_dir = debugfs_create_dir("selftest_helpers", NULL);
> - if (!selftest_dir)
> + if (IS_ERR(selftest_dir))
> return -ENOMEM;
With this you most likely want to propagate error code to the caller
return PTR_ERR(selftest_dir);
BUT, we usually don't check debugfs error codes as the program should work
anyway. Does this test case actually _rely_ on debugfs to be functional?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists