[PATCH v2] drm/bridge: display-connector: implement the error path of .probe()
Dmitry Baryshkov
dmitry.baryshkov at linaro.org
Sat Dec 14 15:22:47 UTC 2024
On Sat, Dec 14, 2024 at 10:26:52AM +0900, Joe Hattori wrote:
> Current implementation of .probe() leaks a reference of i2c_adapter.
> Implement an error path and call put_device() on the obtained
> i2c_adapter in it to fix this refcount bug.
>
> This bug was found by an experimental static analysis tool that I am
> developing.
>
> Fixes: 0c275c30176b ("drm/bridge: Add bridge driver for display connectors")
> Signed-off-by: Joe Hattori <joe at pf.is.s.u-tokyo.ac.jp>
> ---
> Changes in V2:
> - Omit the null check before calling i2c_put_adapter().
> ---
> drivers/gpu/drm/bridge/display-connector.c | 27 +++++++++++++++-------
> 1 file changed, 19 insertions(+), 8 deletions(-)
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
--
With best wishes
Dmitry
More information about the dri-devel
mailing list