mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
stable inclusion from stable-v5.10.183 commit 5a445c2bf651ed0b762ae781c737a93151f33d7a category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5a445c2bf651ed0b762ae781c737a93151f33d7a -------------------------------- [ 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:Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by:
Lee Jones <lee@kernel.org> Signed-off-by:
Jassi Brar <jaswinder.singh@linaro.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment