Skip to content

Commit

Permalink
udl-kms: fix crash due to uninitialized memory
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
Mikulas Patocka authored and airlied committed Jul 30, 2018
1 parent 542bb97 commit 09a00ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/udl/udl_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int udl_fb_open(struct fb_info *info, int user)

struct fb_deferred_io *fbdefio;

fbdefio = kmalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);
fbdefio = kzalloc(sizeof(struct fb_deferred_io), GFP_KERNEL);

if (fbdefio) {
fbdefio->delay = DL_DEFIO_WRITE_DELAY;
Expand Down

0 comments on commit 09a00ab

Please sign in to comment.