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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1103141484.974980.1645523606875@webmail.strato.com>
Date:   Tue, 22 Feb 2022 10:53:26 +0100 (CET)
From:   Ulrich Hecht <uli@...nd.eu>
To:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
        Wolfgang Grandegger <wg@...ndegger.com>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, linux-can@...r.kernel.org,
        Pavel Machek <pavel@...x.de>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org,
        Ulrich Hecht <uli+renesas@...nd.eu>,
        Prabhakar <prabhakar.csengg@...il.com>,
        Biju Das <biju.das.jz@...renesas.com>
Subject: Re: [PATCH] can: rcar_canfd: Register the CAN device when fully
 ready


> On 02/21/2022 11:59 PM Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com> wrote:
> 
>  
> Register the CAN device only when all the necessary initialization
> is completed. This patch makes sure all the data structures and locks are
> initialized before registering the CAN device.
> 
> Reported-by: Pavel Machek <pavel@...x.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> ---
>  drivers/net/can/rcar/rcar_canfd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
> index 3ad3a6f6a1dd..8c378b20b2aa 100644
> --- a/drivers/net/can/rcar/rcar_canfd.c
> +++ b/drivers/net/can/rcar/rcar_canfd.c
> @@ -1783,15 +1783,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
>  
>  	netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll,
>  		       RCANFD_NAPI_WEIGHT);
> +	spin_lock_init(&priv->tx_lock);
> +	devm_can_led_init(ndev);
> +	gpriv->ch[priv->channel] = priv;
>  	err = register_candev(ndev);
>  	if (err) {
>  		dev_err(&pdev->dev,
>  			"register_candev() failed, error %d\n", err);
>  		goto fail_candev;
>  	}
> -	spin_lock_init(&priv->tx_lock);
> -	devm_can_led_init(ndev);
> -	gpriv->ch[priv->channel] = priv;
>  	dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel);
>  	return 0;
>  
> -- 
> 2.17.1

Reviewed-by: Ulrich Hecht <uli+renesas@...nd.eu>

CU
Uli

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ