Skip to content
Commit 5a445c2b authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()



[ Upstream commit 8fe72b76 ]

There was a bug where this code forgot to unlock the tdev->mutex if the
kzalloc() failed.  Fix this issue, by moving the allocation outside the
lock.

Fixes: 2d1e952a ("mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarLee Jones <lee@kernel.org>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c05ac53b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment