Re: [PATCH v3] iio: frequency: admv1013: fix NULL pointer dereference on str
From: Andy Shevchenko
Date: Wed Mar 04 2026 - 09:26:39 EST
On Wed, Mar 04, 2026 at 11:58:18AM +0200, Antoniu Miclaus wrote:
> When device_property_read_string() fails, str is left uninitialized
> but the code falls through to strcmp(str, ...), dereferencing a garbage
> pointer. Replace manual read/strcmp with
> device_property_match_property_string() which reads the property as a
> single string value and matches it against an array of known valid
> strings, handling the missing property case internally.
Same comment applies as per v2.
TL;DR: We may reuse the original enum. See there how.
--
With Best Regards,
Andy Shevchenko