diff options
author | Dawid Kurek <dawikur@gmail.com> | 2017-06-15 19:45:56 +0200 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2017-06-15 14:26:02 -0400 |
commit | ac7c748317f515f426f48e72964c71142506f7a6 (patch) | |
tree | c4a29089c7d52d71413cf5bad1eed113c3563bff /drivers/gpu/drm/drm_atomic.c | |
parent | ae9d04214372a521e3746556eb2f76007d9edb73 (diff) | |
download | talos-obmc-linux-ac7c748317f515f426f48e72964c71142506f7a6.tar.gz talos-obmc-linux-ac7c748317f515f426f48e72964c71142506f7a6.zip |
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 <dawikur@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20170615174556.GA8872@gmail.com
Diffstat (limited to 'drivers/gpu/drm/drm_atomic.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |