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]
Message-ID: <AANLkTimHkwDnzKhWh2fD_-ue0-m-+6evPNz=BQZTOis-@mail.gmail.com>
Date:	Sat, 19 Mar 2011 13:05:46 +0800
From:	Po-Yu Chuang <ratbert.chuang@...il.com>
To:	Dan Carpenter <error27@...il.com>
Cc:	Po-Yu Chuang <ratbert@...aday-tech.com>,
	Eric Dumazet <eric.dumazet@...il.com>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch] ftmac100: use resource_size()

Hi Dan,

On Sat, Mar 19, 2011 at 12:39 PM, Dan Carpenter <error27@...il.com> wrote:
> The calculation is off-by-one.  It should be "end - start + 1".  This
> patch fixes it to use resource_size() instead.  Oddly, the code already
> uses resource size correctly a couple lines earlier when it calls
> request_mem_region() for this memory.
>
> Signed-off-by: Dan Carpenter <error27@...il.com>
>
> diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
> index 1d6f4b8..a316619 100644
> --- a/drivers/net/ftmac100.c
> +++ b/drivers/net/ftmac100.c
> @@ -1102,7 +1102,7 @@ static int ftmac100_probe(struct platform_device *pdev)
>                goto err_req_mem;
>        }
>
> -       priv->base = ioremap(res->start, res->end - res->start);
> +       priv->base = ioremap(res->start, resource_size(res));
>        if (!priv->base) {
>                dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n");
>                err = -EIO;

Ah, I incautiously missed that line when code review.

Thanks,
Po-Yu Chuang
--
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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ