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:	Tue, 24 Dec 2013 11:22:36 +0800
From:	tingwei liu <tingw.liu@...il.com>
To:	Libin <huawei.libin@...wei.com>
Cc:	davem@...emloft.net, hsweeten@...ionengravers.com,
	gregkh@...uxfoundation.org, tedheadster@...il.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	dingtianhong@...wei.com
Subject: Re: [PATCH] drivers/net: Fix potential incorrect call for udelay()

On Mon, Dec 23, 2013 at 5:33 PM, Libin <huawei.libin@...wei.com> wrote:
>
> From: Li Bin <huawei.libin@...wei.com>
>
> The variable delay_time as a module parameter can be set a value
> exceeding the limit of the udelay function. This patch checks the
> delay_time value to select mdelay() or udelay().
>
> Signed-off-by: Li Bin <huawei.libin@...wei.com>
> ---
>  drivers/net/ethernet/8390/pcnet_cs.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
> index 46c5aad..29fe157 100644
> --- a/drivers/net/ethernet/8390/pcnet_cs.c
> +++ b/drivers/net/ethernet/8390/pcnet_cs.c
> @@ -1284,8 +1284,12 @@ static void dma_block_output(struct net_device *dev, int count,
>         }
>
>      outb_p(ENISR_RDC, nic_base + EN0_ISR);     /* Ack intr. */
> -    if (info->flags & DELAY_OUTPUT)
> -       udelay((long)delay_time);
> +    if (info->flags & DELAY_OUTPUT) {
> +               if (delay_time >= 1000)
> +                       mdelay((long)delay_time/1000);

Indeed use of mdelay is discouraged.
I prefer to limit delay_time less than 1000.

Tingwei
>
> +               else
> +                       udelay(delay_time);
> +       }
>      ei_status.dmaing &= ~0x01;
>  }
>
> --
> 1.8.2.2
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ