[PATCH net-next] dibs: Check correct variable in dibs_init()

Dan Carpenter posted 1 patch 1 week ago
drivers/dibs/dibs_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH net-next] dibs: Check correct variable in dibs_init()
Posted by Dan Carpenter 1 week ago
There is a typo in this code.  It should check "dibs_class" instead of
"&dibs_class".  Remove the &.

Fixes: 804737349813 ("dibs: Create class dibs")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/dibs/dibs_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c
index 5425238d5a42..0374f8350ff7 100644
--- a/drivers/dibs/dibs_main.c
+++ b/drivers/dibs/dibs_main.c
@@ -258,8 +258,8 @@ static int __init dibs_init(void)
 	max_client = 0;
 
 	dibs_class = class_create("dibs");
-	if (IS_ERR(&dibs_class))
-		return PTR_ERR(&dibs_class);
+	if (IS_ERR(dibs_class))
+		return PTR_ERR(dibs_class);
 
 	rc = dibs_loopback_init();
 	if (rc)
-- 
2.51.0
Re: [PATCH net-next] dibs: Check correct variable in dibs_init()
Posted by Alexandra Winter 1 week ago

On 24.09.25 16:21, Dan Carpenter wrote:
> There is a typo in this code.  It should check "dibs_class" instead of
> "&dibs_class".  Remove the &.
> 
> Fixes: 804737349813 ("dibs: Create class dibs")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/dibs/dibs_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dibs/dibs_main.c b/drivers/dibs/dibs_main.c
> index 5425238d5a42..0374f8350ff7 100644
> --- a/drivers/dibs/dibs_main.c
> +++ b/drivers/dibs/dibs_main.c
> @@ -258,8 +258,8 @@ static int __init dibs_init(void)
>  	max_client = 0;
>  
>  	dibs_class = class_create("dibs");
> -	if (IS_ERR(&dibs_class))
> -		return PTR_ERR(&dibs_class);
> +	if (IS_ERR(dibs_class))
> +		return PTR_ERR(dibs_class);
>  
>  	rc = dibs_loopback_init();
>  	if (rc)

oops, this has been wrong since the first RFC in february.
Great catch, thank you Dan.

Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>