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  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]
Date:   Tue, 4 Apr 2017 17:34:02 +0200
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Akshay Bhat <akshay.bhat@...esys.com>, wg@...ndegger.com
Cc:     linux-can@...r.kernel.org, netdev@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        Akshay Bhat <nodeax@...il.com>
Subject: Re: [PATCH v4 2/2] can: spi: hi311x: Add Holt HI-311x CAN driver

On 03/24/2017 06:20 PM, Akshay Bhat wrote:
> Hi Marc,
> 
> On 03/17/2017 05:10 PM, Akshay Bhat wrote:
>> This patch adds support for the Holt HI-311x CAN controller. The HI311x
>> CAN controller is capable of transmitting and receiving standard data
>> frames, extended data frames and remote frames. The HI311x interfaces
>> with the host over SPI.
>>
>> Datasheet: www.holtic.com/documents/371-hi-3110_v-rev-jpdf.do
>>
>> Signed-off-by: Akshay Bhat <nodeax@...il.com>
>> ---
>>
> 
> If there are no further review comments can this series be applied to
> can-next or does it need to wait for the next kernel release cycle (4.13)?

The driver doesn't check if the workqueue allocation is successfull,
I've squashed this patch:

> diff --git a/drivers/net/can/spi/hi311x.c b/drivers/net/can/spi/hi311x.c
> index ff4bb40d855e..170e8e3971b2 100644
> --- a/drivers/net/can/spi/hi311x.c
> +++ b/drivers/net/can/spi/hi311x.c
> @@ -780,20 +780,24 @@ static int hi3110_open(struct net_device *net)
>  
>         priv->wq = alloc_workqueue("hi3110_wq", WQ_FREEZABLE | WQ_MEM_RECLAIM,
>                                    0);
> +       if (!priv->wq) {
> +               ret = -ENOMEM;
> +               goto out_free_irq;
> +       }
>         INIT_WORK(&priv->tx_work, hi3110_tx_work_handler);
>         INIT_WORK(&priv->restart_work, hi3110_restart_work_handler);
>  
>         ret = hi3110_hw_reset(spi);
>         if (ret)
> -               goto out_free_irq;
> +               goto out_free_wq;
>  
>         ret = hi3110_setup(net);
>         if (ret)
> -               goto out_free_irq;
> +               goto out_free_wq;
>  
>         ret = hi3110_set_normal_mode(spi);
>         if (ret)
> -               goto out_free_irq;
> +               goto out_free_wq;
>  
>         can_led_event(net, CAN_LED_EVENT_OPEN);
>         netif_wake_queue(net);
> @@ -801,11 +805,12 @@ static int hi3110_open(struct net_device *net)
>  
>         return 0;
>  
> -out_free_irq:
> + out_free_wq:
> +       destroy_workqueue(priv->wq);
> + out_free_irq:
>         free_irq(spi->irq, priv);
>         hi3110_hw_sleep(spi);
> -
> -out_close:
> + out_close:
>         hi3110_power_enable(priv->transceiver, 0);
>         close_candev(net);
>         mutex_unlock(&priv->hi3110_lock);

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists