From: Dawid Kurek Date: Thu, 15 Jun 2017 17:45:56 +0000 (+0200) Subject: drm: Reduce scope of 'state' variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac7c748317f515f426f48e72964c71142506f7a6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: Reduce scope of 'state' variable Smaller scope reduces visibility of variable and makes usage of uninitialized variable less possible. Changes in v2: - separate declaration and initialization Changes in v3: - add missing signed-off-by tag Signed-off-by: Dawid Kurek Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/20170615174556.GA8872@gmail.com --- diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 77dcef00998c..c0f336d23f9c 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -109,9 +109,10 @@ struct drm_atomic_state * drm_atomic_state_alloc(struct drm_device *dev) { struct drm_mode_config *config = &dev->mode_config; - struct drm_atomic_state *state; if (!config->funcs->atomic_state_alloc) { + struct drm_atomic_state *state; + state = kzalloc(sizeof(*state), GFP_KERNEL); if (!state) return NULL;