# Re: \[PATCH v2 1/5\] drm/modes: parse\_cmdline: Handle empty mode name part

- From: Maxime Ripard \<hidden\>
- Date: 2022-07-14 12:05:15 
- List: linux-fbdev
- Page: https://ratatoskr.run/linux-fbdev/2022/07/1859489
- Thread: https://ratatoskr.run/dri-devel/2022/07/1859352/t.md

```text
Hi,

On Thu, Jul 14, 2022 at 11:04:06AM +0200, Geert Uytterhoeven wrote:
> If no mode name part was specified, mode_end is zero, and the "ret ==
> mode_end" check does the wrong thing.
> 
> Fix this by skipping all named mode handling when mode_end is zero.
> 
> Fixes: 7b1cce760afe38b4 ("drm/modes: parse_cmdline: Allow specifying stand-alone options")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Reviewed-by: Hans de Goede <redacted>
> Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

We should add a test for that in drivers/gpu/drm/tests/drm_cmdline_parser_test.c

Maxime
```

## Attachments

- [signature.asc](https://ratatoskr.run/linux-fbdev/2022/07/1859489/attachment/0) (application/pgp-signature, 228 bytes)
