]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: dsi: Initialize msm_dsi->id to -1
authorSean Paul <seanpaul@chromium.org>
Mon, 30 Jul 2018 15:26:53 +0000 (11:26 -0400)
committerRob Clark <robdclark@gmail.com>
Thu, 4 Oct 2018 00:24:49 +0000 (20:24 -0400)
commit4524a01cbd3e11be1d1fbd7efcfae9ac514cd770
treecacafec9911892aea8ea4f45f89fbb8440f2627b
parentcdf42d3aa6c1626ba890500e4b1f4da4929aad00
drm/msm: dsi: Initialize msm_dsi->id to -1

Currently msm_dsi->id is initialized to 0 during kzalloc. If bind fails
for a secondary dsi device before its id can be properly set (such as
during dt parsing), the id will point to the primary dsi device, causing
its reference to be removed from dsi_manager's global (msm_dsim_glb)
array.

This patch initializes the id to -1 and checks for negative in the
manager cleanup.

Cc: Doug Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/dsi/dsi.c
drivers/gpu/drm/msm/dsi/dsi_manager.c