[lvc-project] [PATCH] drm/meson: add check to prevent dereference of NULL
Martin Blumenstingl
martin.blumenstingl at googlemail.com
Fri Aug 16 22:55:37 MSK 2024
Hello Anastasia,
On Mon, Aug 12, 2024 at 11:32 AM Anastasia Belova <abelova at astralinux.ru> wrote:
[...]
> > As an alternative to your suggested approach: could you please look
> > into whether devm_drm_dev_alloc() is a suitable replacement (if not:
> > just explain why - then this patch is good to be merged)?
>
> If I understood correctly, devm_drm_dev_alloc allows to delete drm_dev_put
> from error path in meson_drv_bind_master and in meson_drv_unbind.
Correct, that's the idea.
> Then the proposed check may be ommited and function may just return
> instead of jumping to free_drm.
That's right
> And would it be better to rename free_drm to remove_encoders?
That free_drm label is very confusing anyways.
The short answer is: yes
The longer answer is: we'll need to work on the removal order again:
- encoders are probed *after* afbcd
- removal should happen in opposite order of probe, so encoders should
be freed *before* afbcd
- however, this order is not implemented
There's no harm for you to rename the label now. It just means that we
need to do some more cleanups.
Looking forward to v2 of the patch!
Best regards,
Martin
More information about the lvc-project
mailing list