diff mbox series

[v2,15/33] drm/modes: Bail out of named mode parsing if empty

Message ID 20220728-rpi-analog-tv-properties-v2-15-f733a0ed9f90@cerno.tech (mailing list archive)
State New, archived
Headers show
Series drm: Analog TV Improvements | expand

Commit Message

Maxime Ripard Sept. 22, 2022, 2:25 p.m. UTC
If the name we want to parse has a length of zero, there's no need to
compare it to the list of all the named modes we support, we can return
straight away.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index b1e800e4ed60..8d629fbb1047 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -2235,6 +2235,9 @@  static int drm_mode_parse_cmdline_named_mode(const char *name,
 {
 	unsigned int i;
 
+	if (!name_end)
+		return 0;
+
 	/*
 	 * We're sure we're a named mode at that point, iterate over the
 	 * list of modes we're aware of.