[ Upstream commit 8fe72b76db79d694858e872370df49676bc3be8c ]
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: 2d1e952a2b8e ("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>
|
||
|---|---|---|
| .. | ||
| apple-mailbox.c | ||
| arm_mhu.c | ||
| arm_mhu_db.c | ||
| arm_mhuv2.c | ||
| armada-37xx-rwtm-mailbox.c | ||
| bcm-flexrm-mailbox.c | ||
| bcm-pdc-mailbox.c | ||
| bcm2835-mailbox.c | ||
| hi3660-mailbox.c | ||
| hi6220-mailbox.c | ||
| imx-mailbox.c | ||
| Kconfig | ||
| mailbox-altera.c | ||
| mailbox-mpfs.c | ||
| mailbox-sti.c | ||
| mailbox-test.c | ||
| mailbox-xgene-slimpro.c | ||
| mailbox.c | ||
| mailbox.h | ||
| Makefile | ||
| mtk-adsp-mailbox.c | ||
| mtk-cmdq-mailbox.c | ||
| omap-mailbox.c | ||
| pcc.c | ||
| pl320-ipc.c | ||
| platform_mhu.c | ||
| qcom-apcs-ipc-mailbox.c | ||
| qcom-ipcc.c | ||
| rockchip-mailbox.c | ||
| sprd-mailbox.c | ||
| stm32-ipcc.c | ||
| sun6i-msgbox.c | ||
| tegra-hsp.c | ||
| ti-msgmgr.c | ||
| zynqmp-ipi-mailbox.c | ||