Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mailbox: mailbox-test: don't free the reused channel

The RX channel can be aliased to the TX channel if it has a different
MMIO. This special case needs to be handled when freeing the channels
otherwise a double-free occurs.

Fixes: 8ea4484d0c2b ("mailbox: Add generic mechanism for testing Mailbox Controllers")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>

authored by

Wolfram Sang and committed by
Jassi Brar
88ebadbf dd9aa1f2

+2 -2
+2 -2
drivers/mailbox/mailbox-test.c
··· 427 427 err_free_chans: 428 428 if (tdev->tx_channel) 429 429 mbox_free_channel(tdev->tx_channel); 430 - if (tdev->rx_channel) 430 + if (tdev->rx_channel && tdev->rx_channel != tdev->tx_channel) 431 431 mbox_free_channel(tdev->rx_channel); 432 432 return ret; 433 433 } ··· 440 440 441 441 if (tdev->tx_channel) 442 442 mbox_free_channel(tdev->tx_channel); 443 - if (tdev->rx_channel) 443 + if (tdev->rx_channel && tdev->rx_channel != tdev->tx_channel) 444 444 mbox_free_channel(tdev->rx_channel); 445 445 } 446 446