Re: [PATCH v2 2/2] auxdisplay: charlcd: checking for pointer reference before dereferencing

From: Miguel Ojeda
Date: Wed Nov 24 2021 - 06:02:10 EST


On Tue, Nov 9, 2021 at 11:07 PM Luiz Sampaio <sampaio.ime@xxxxxxxxx> wrote:
>
> Check if the pointer lcd->ops->init_display exists before dereferencing it.
> If a driver called charlcd_init() without defining the ops, this would
> return segmentation fault, as happened to me when implementing a charlcd
> driver. Checking the pointer before dereferencing protects from
> segmentation fault.
>
> Signed-off-by: Luiz Sampaio <sampaio.ime@xxxxxxxxx>

Queued up, thanks!

Cheers,
Miguel