lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 27 May 2022 09:35:33 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     keliu <liuke94@...wei.com>, andrew@...n.ch, hkallweit1@...il.com,
        linux@...linux.org.uk, davem@...emloft.net, edumazet@...gle.com,
        kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: Directly use ida_alloc()/free()

Hi,

Le 27/05/2022 à 09:40, keliu a écrit :
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
> 
> Signed-off-by: keliu <liuke94@...wei.com>
> ---
>   drivers/net/phy/fixed_phy.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
> index c65fb5f5d2dc..63e7922bf257 100644
> --- a/drivers/net/phy/fixed_phy.c
> +++ b/drivers/net/phy/fixed_phy.c
> @@ -180,7 +180,7 @@ static void fixed_phy_del(int phy_addr)
>   			if (fp->link_gpiod)
>   				gpiod_put(fp->link_gpiod);
>   			kfree(fp);
> -			ida_simple_remove(&phy_fixed_ida, phy_addr);
> +			ida_free(&phy_fixed_ida, phy_addr);
>   			return;
>   		}
>   	}
> @@ -250,7 +250,7 @@ static struct phy_device *__fixed_phy_register(unsigned int irq,
>   
>   	ret = fixed_phy_add_gpiod(irq, phy_addr, status, gpiod);
>   	if (ret < 0) {
> -		ida_simple_remove(&phy_fixed_ida, phy_addr);
> +		ida_free(&phy_fixed_ida, phy_addr);
>   		return ERR_PTR(ret);
>   	}
>   

Hi,

You missed ida_simple_get() that shoud become ida_alloc_max() here.

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ