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: <wd5qlrd5c3kmguosjqyi7w7oayvjfh3mrzuw7nx64ibagmtkck@bczrrshd7a43>
Date: Wed, 28 Feb 2024 11:28:32 +0200
From: Laurentiu Palcu <laurentiu.palcu@....nxp.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Philipp Stanner <pstanner@...hat.com>, 
	Lucas Stach <l.stach@...gutronix.de>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>, 
	Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, 
	David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>, Shawn Guo <shawnguo@...nel.org>, 
	Sascha Hauer <s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>, 
	Fabio Estevam <festevam@...il.com>, NXP Linux Team <linux-imx@....com>, 
	dri-devel@...ts.freedesktop.org, linux-arm-kernel@...ts.infradead.org, 
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] drm/imx/dcss: fix resource size calculation

Hi Dan,

On Tue, Feb 13, 2024 at 09:05:01PM +0300, Dan Carpenter wrote:
> The resource is inclusive of the ->start and ->end addresses so this
> calculation is not correct.  It should be "res->end - res->start + 1".
> Use the resource_size() to do the calculation.
> 
> Fixes: 90393c9b5408 ("drm/imx/dcss: request memory region")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@....nxp.com>

And pushed to drm-misc-next-fixes.

Thanks,
Laurentiu

> ---
> From static analysis.  Not tested.
> 
>  drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> index 597e9b7bd4bf..7fd0c4c14205 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
> @@ -167,7 +167,6 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
>  	struct resource *res;
>  	struct dcss_dev *dcss;
>  	const struct dcss_type_data *devtype;
> -	resource_size_t res_len;
>  
>  	devtype = of_device_get_match_data(dev);
>  	if (!devtype) {
> @@ -181,8 +180,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output)
>  		return ERR_PTR(-EINVAL);
>  	}
>  
> -	res_len = res->end - res->start;
> -	if (!devm_request_mem_region(dev, res->start, res_len, "dcss")) {
> +	if (!devm_request_mem_region(dev, res->start, resource_size(res), "dcss")) {
>  		dev_err(dev, "cannot request memory region\n");
>  		return ERR_PTR(-EBUSY);
>  	}
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ