Skip to content

Commit 2c3d694

Browse files
6by9pelwell
authored andcommitted
drm/modes: Handle reflect_[xy] in the middle of the cmd line
The command line parser was looking for an "=" before the "," separator. If the command line had reflect_[xy] before another option which took a parameter, it would find the "=" from the second option and assume it was associated with the reflect option, generally leading to a parsing failure. Handle this case by looking for both "," and "=", and taking the first instance. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 8d376f1 commit 2c3d694

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/drm_modes.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2173,12 +2173,15 @@ static int drm_mode_parse_cmdline_options(const char *str,
21732173

21742174
option = str;
21752175
do {
2176+
sep = strchr(option, ',');
21762177
delim = strchr(option, '=');
21772178
if (!delim) {
2178-
delim = strchr(option, ',');
2179-
2180-
if (!delim)
2179+
if (!sep)
21812180
delim = option + strlen(option);
2181+
else
2182+
delim = sep;
2183+
} else if (sep && sep < delim) {
2184+
delim = sep;
21822185
}
21832186

21842187
if (!strncmp(option, "rotate", delim - option)) {

0 commit comments

Comments
 (0)