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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220106101757.4sd7d3nvoeatjzuq@mail.igalia.com>
Date:   Thu, 6 Jan 2022 09:17:57 -0100
From:   Melissa Wen <mwen@...lia.com>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     emma@...olt.net, airlied@...ux.ie, daniel@...ll.ch,
        p.zabel@...gutronix.de, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH] drm/v3d/v3d_drv: Check for error num after setting mask

On 01/06, Jiasheng Jiang wrote:
> Because of the possible failure of the dma_supported(), the
> dma_set_mask_and_coherent() may return error num.
> Therefore, it should be better to check it and return the error if
> fails.
> 
> Fixes: 334dd38a3878 ("drm/v3d: Set dma_mask as well as coherent_dma_mask")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  drivers/gpu/drm/v3d/v3d_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
> index 99e22beea90b..bedd52195723 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.c
> +++ b/drivers/gpu/drm/v3d/v3d_drv.c
> @@ -232,8 +232,11 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	mmu_debug = V3D_READ(V3D_MMU_DEBUG_INFO);
> -	dma_set_mask_and_coherent(dev,
> +	ret = dma_set_mask_and_coherent(dev,
>  		DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH)));
> +	if (ret)
> +		return ret;
> +
lgtm, thanks!

Reviewed-by: Melissa Wen <mwen@...lia.com>

>  	v3d->va_width = 30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_VA_WIDTH);
>  
>  	ident1 = V3D_READ(V3D_HUB_IDENT1);
> -- 
> 2.25.1
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ