lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] bus:Fix error checking for debugfs_create_dir() in mvebu_mbus_debugfs_init()
On Wed, Jul 12, 2023 at 09:23:28PM +0800, Wang Ming wrote:
> debugfs_create_dir() does not return NULL,but it is
> possible to return error pointer. Most incorrect error checks
> were fixed,but the one in mvebu_mbus_debugfs_init() was forgotten.
>
> Fix the remaining error check.
>
> Signed-off-by: Wang Ming <machel@vivo.com>
> ---
> drivers/bus/mvebu-mbus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
> index 00cb792bda18..4c514894cc1f 100644
> --- a/drivers/bus/mvebu-mbus.c
> +++ b/drivers/bus/mvebu-mbus.c
> @@ -993,7 +993,7 @@ static __init int mvebu_mbus_debugfs_init(void)
> return 0;
>
> s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL);
> - if (s->debugfs_root) {
> + if (!IS_ERR(s->debugfs_root)) {

No need for this check at all.

thanks,

greg k-h

\
 
 \ /
  Last update: 2023-08-04 16:09    [W:0.029 / U:2.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site