Skip to content

Commit

Permalink
gdrdrv: fix use-after-free of variable mr in case of error
Browse files Browse the repository at this point in the history
This used to crash the kernel when something went wrong.
  • Loading branch information
daniel-k committed Jul 3, 2018
1 parent 158ae88 commit 37a2e2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdrdrv/gdrdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ static int gdrdrv_pin_buffer(gdr_info_t *info, void __user *_params)
}

if (ret && mr) {
kfree(mr);
memset(mr, 0, sizeof(*mr));
kfree(mr);
mr = NULL;
}

Expand Down

0 comments on commit 37a2e2f

Please sign in to comment.