Skip to content

Commit 03ddf0e

Browse files
6by9popcornmix
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 <[email protected]>
1 parent 7b2fbee commit 03ddf0e

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
@@ -2172,12 +2172,15 @@ static int drm_mode_parse_cmdline_options(const char *str,
21722172

21732173
option = str;
21742174
do {
2175+
sep = strchr(option, ',');
21752176
delim = strchr(option, '=');
21762177
if (!delim) {
2177-
delim = strchr(option, ',');
2178-
2179-
if (!delim)
2178+
if (!sep)
21802179
delim = option + strlen(option);
2180+
else
2181+
delim = sep;
2182+
} else if (sep && sep < delim) {
2183+
delim = sep;
21812184
}
21822185

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

0 commit comments

Comments
 (0)