Re: [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 22, 2023 at 12:07:10PM +0300, Dan Carpenter wrote:
> Don't dereference "db->dsi_dev" when it is an error pointer.
> 
> Fixes: 249a4f5e663c ("drm/panel: Add Magnachip D53E6EA8966 Panel Driver")
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> ---
>  drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> index 8c362c40227f..26d358b9b85a 100644
> --- a/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> +++ b/drivers/gpu/drm/panel/panel-magnachip-d53e6ea8966.c
> @@ -418,7 +418,7 @@ static int d53e6ea8966_probe(struct spi_device *spi)
>  	if (IS_ERR(db->dsi_dev)) {
>  		dev_err(dev, "failed to register dsi device: %ld\n",
>  			PTR_ERR(db->dsi_dev));
> -		ret = PTR_ERR(db->dsi_dev);
> +		return PTR_ERR(db->dsi_dev);
>  	}
>  
>  	db->dsi_dev->lanes = 2;
> -- 
> 2.39.1
> 

Thank you for the patch, this looks good to me. Not sure how I
missed that.

Chris Morgan



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux