mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mailbox: mailbox-test: set tdev->signal to NULL after freeing
tdev->signal is not set NULL after it's freed. This will cause random
exceptions when the stale pointer is accessed after tdev->signal is
freed. Also, since tdev->signal allocation is skipped the next time
it's written, this leads to continuous fault finally leading to the
total death of the system.
Fixes: d1c2f87c9a ("mailbox: mailbox-test: Prevent memory leak")
Signed-off-by: Sudeep Holla <[email protected]>
Acked-by: Lee Jones <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
This commit is contained in:
parent
8714f8f5fe
commit
9ef3c51121
1 changed files with 1 additions and 0 deletions
|
|
@ -133,6 +133,7 @@ static ssize_t mbox_test_message_write(struct file *filp,
|
|||
out:
|
||||
kfree(tdev->signal);
|
||||
kfree(tdev->message);
|
||||
tdev->signal = NULL;
|
||||
|
||||
return ret < 0 ? ret : count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue