diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2018-06-03 10:40:57 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2018-07-30 18:03:48 -0400 |
commit | 09a00abe3a9941c2715ca83eb88172cd2f54d8fd (patch) | |
tree | 62ad3afee5fc522e67ca8fc5016c2ffde1c854ef | |
parent | 542bb9788a1f485eb1a2229178f665d8ea166156 (diff) |
udl-kms: fix crash due to uninitialized memory
We must use kzalloc when allocating the fb_deferred_io structure.
Otherwise, the field first_io is undefined and it causes a crash.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/udl/udl_fb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index d5583190f3e4..c3f5867dac91 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c | |||
@@ -221,7 +221,7 @@ static int udl_fb_open(struct fb_info *info, int user) | |||
221 | 221 | ||
222 | struct fb_deferred_io *fbdefio; | 222 | struct fb_deferred_io *fbdefio; |
223 | 223 | ||
224 | fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); | 224 | fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL); |
225 | 225 | ||
226 | if (fbdefio) { | 226 | if (fbdefio) { |
227 | fbdefio->delay = DL_DEFIO_WRITE_DELAY; | 227 | fbdefio->delay = DL_DEFIO_WRITE_DELAY; |