dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe
@ 2023-03-22  9:07 Dan Carpenter
  2023-03-24 22:03 ` Chris Morgan
  2023-03-27 21:23 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-03-22  9:07 UTC (permalink / raw)
  To: Chris Morgan
  Cc: Sam Ravnborg, kernel-janitors, dri-devel, Chris Morgan, Maya Matuszczyk

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@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe
  2023-03-22  9:07 [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe Dan Carpenter
@ 2023-03-24 22:03 ` Chris Morgan
  2023-03-27 21:23 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Morgan @ 2023-03-24 22:03 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Sam Ravnborg, kernel-janitors, dri-devel, Maya Matuszczyk

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@gmail.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe
  2023-03-22  9:07 [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe Dan Carpenter
  2023-03-24 22:03 ` Chris Morgan
@ 2023-03-27 21:23 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2023-03-27 21:23 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Morgan, Sam Ravnborg, kernel-janitors, dri-devel, Maya Matuszczyk

On Wed, Mar 22, 2023 at 10:07 AM Dan Carpenter <error27@gmail.com> 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@gmail.com>

Patch applied to drm-misc-next!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-27 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22  9:07 [PATCH] drm/panel: magnachip: Prevent error pointer dereference in probe Dan Carpenter
2023-03-24 22:03 ` Chris Morgan
2023-03-27 21:23 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).