[PATCH 1/2] drm/i2c/ch7006: Add a check to prevent NULL pointer dereference

Dmitry Baryshkov dmitry.baryshkov at linaro.org
Thu Oct 31 21:49:32 UTC 2024


On Fri, Oct 25, 2024 at 03:34:07PM +0800, Zhang Zekun wrote:
> drm_mode_duplicate() could return NULL due to lack of memory,
> which will then call NULL pointer dereference. Add a check to
> prevent it.
> 
> Fixes: 6ee738610f41 ("drm/nouveau: Add DRM driver for NVIDIA GPUs")
> Signed-off-by: Zhang Zekun <zhangzekun11 at huawei.com>
> ---
>  drivers/gpu/drm/i2c/ch7006_drv.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>

-- 
With best wishes
Dmitry


More information about the dri-devel mailing list