Re: [PATCH v2] mtd: rawnand: meson: initialize struct with zeroes

From: Martin Blumenstingl
Date: Tue Feb 21 2023 - 16:31:49 EST


Hello Arseniy,

On Tue, Feb 21, 2023 at 11:07 AM Arseniy Krasnov
<AVKrasnov@xxxxxxxxxxxxxx> wrote:
>
> This structure must be zeroed, because it's field 'hw->core' is used as
> 'parent' in 'clk_core_fill_parent_index()', but it will be uninitialized.
> This happens, because when this struct is not zeroed, pointer 'hw' is
> "initialized" by garbage, which is valid pointer, but points to some
> garbage. So 'hw' will be dereferenced, but 'core' contains some random
> data which will be interpreted as pointer.
I think this should be written as "interpreted as a pointer". I'm not
a native English speaker though, so I'm hoping that someone else can
provide feedback as well.

[...]
> Fixes: 1e4d3ba66888 ("mtd: rawnand: meson: fix the clock")
> Signed-off-by: Arseniy Krasnov <AVKrasnov@xxxxxxxxxxxxxx>
Regardless of my comment above:
Acked-by: Martin Blumenstingl <martin.blumenstingl@xxxxxxxxxxxxxx>


Best regards,
Martin