kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] drm/panel: fix null pointer dereference on pointer mode
@ 2020-09-18 15:51 Colin King
  2020-09-18 16:22 ` Guido Günther
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-09-18 15:51 UTC (permalink / raw)
  To: Guido Günther, Purism Kernel Team, Thierry Reding,
	Sam Ravnborg, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel
  Cc: kernel-janitors

From: Colin Ian King <colin.king@canonical.com>

Currently a null pointer check on pointer mode is passing mode to
function drm_mode_vrefresh and this causes a null pointer dereference
on mode.  Fix this by not calling drm_mode_vrefresh since the call
is only required for error reporting.

Addresses-Coverity: ("Dereference after null check")
Fixes: 72967d5616d3 ("drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
index 3482e28e30fc..be4761a643f9 100644
--- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -202,9 +202,8 @@ static int mantix_get_modes(struct drm_panel *panel,
 
 	mode = drm_mode_duplicate(connector->dev, &default_mode);
 	if (!mode) {
-		dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
-			default_mode.hdisplay, default_mode.vdisplay,
-			drm_mode_vrefresh(mode));
+		dev_err(ctx->dev, "Failed to add mode %ux%u\n",
+			default_mode.hdisplay, default_mode.vdisplay);
 		return -ENOMEM;
 	}
 
-- 
2.27.0

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

end of thread, other threads:[~2020-09-18 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 15:51 [PATCH][next] drm/panel: fix null pointer dereference on pointer mode Colin King
2020-09-18 16:22 ` Guido Günther
2020-09-18 16:39   ` Colin Ian King

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).