]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: Fix error handling crashes seen when VRAM allocation fails
authorArchit Taneja <architt@codeaurora.org>
Thu, 3 Nov 2016 12:06:18 +0000 (17:36 +0530)
committerRob Clark <robdclark@gmail.com>
Fri, 4 Nov 2016 15:51:37 +0000 (11:51 -0400)
commit1bd495a4862fdc0f2a88242214eaa4a08ea33e5e
treef8a12ca0f5f37825faa7306feaa28a47260546f2
parentfe926e796f2a5a992459364dd03122c35f6f25f6
drm/msm: Fix error handling crashes seen when VRAM allocation fails

If VRAM allocation fails, the error handling path crashes in
msm_drm_uninit(). The following changes are made to fix this:

msm_gem_shrinker_cleanup() is fixed to unregister the shrinker only
if it was init-ed in the first place.

Before calling kms->funcs->destroy(), we check if kms->funcs is also
non-NULL. This is needed for MDP5, since during msm_drm_int(), priv->kms
becomes non-NULL early, but msm_kms_init() is called on it only later
in mdp5_kms_init().

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Andy Gross <andy.gross@linaro.org>
drivers/gpu/drm/msm/msm_drv.c
drivers/gpu/drm/msm/msm_gem_shrinker.c