From ddbcaa93eb37a6a096b5773d98ced66a2b6c45d7 Mon Sep 17 00:00:00 2001 From: Jayaprakash Date: Mon, 22 Feb 2021 13:53:45 +0530 Subject: [PATCH] disp: msm: sde: fix null dereference in drm_atomic_get_property Add changes to fix the null dereference in drm_atomic_get_property caused by connector->state being NULL. This change allows the drm_mode_config_reset operation to happen before drm_dev_register to avoid this. In current scenario, connector->state->crtc is being accessed due to call to drm_mode_getconnector ioctl with the drm_mode_config_reset operation pending. Change-Id: I374d9485819fad85100d1837f4ae22fc2a3ccc40 Signed-off-by: Jayaprakash --- msm/msm_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/msm/msm_drv.c b/msm/msm_drv.c index 180b4662635d..9c6ad1aa60e8 100644 --- a/msm/msm_drv.c +++ b/msm/msm_drv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. * Copyright (C) 2013 Red Hat * Author: Rob Clark * @@ -886,13 +886,13 @@ static int msm_drm_component_init(struct device *dev) } } + drm_mode_config_reset(ddev); + ret = drm_dev_register(ddev, 0); if (ret) goto fail; priv->registered = true; - drm_mode_config_reset(ddev); - if (kms && kms->funcs && kms->funcs->cont_splash_config) { ret = kms->funcs->cont_splash_config(kms, NULL); if (ret) {