Fix test-i2c leak, and mctp_pktbuf storage alignment
- Ensure mctp_pktbuf storage is correctly aligned
- Deallocate mctp and i2c instances to avoid failure with asan.
These previously succeeded in CI so are both fixed in this commit.
Fixes: e5b941d9d764 ("i2c: Add binding for MCTP over I2C transport")
Fixes: 4a09e1dc4883 ("core: Reuse buffers for tx, allow message pools")
Change-Id: I747bfff6faf3a5b0a982ae266bcef02ecbc4ee8a
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
diff --git a/serial.c b/serial.c
index d79c99c..b61991a 100644
--- a/serial.c
+++ b/serial.c
@@ -44,7 +44,7 @@
/* receive buffer and state */
uint8_t rxbuf[1024];
struct mctp_pktbuf *rx_pkt;
- uint8_t rx_storage[MCTP_PKTBUF_SIZE(SERIAL_BTU)];
+ uint8_t rx_storage[MCTP_PKTBUF_SIZE(SERIAL_BTU)] PKTBUF_STORAGE_ALIGN;
uint8_t rx_exp_len;
uint16_t rx_fcs;
uint16_t rx_fcs_calc;
@@ -62,7 +62,7 @@
/* temporary transmit buffer */
uint8_t txbuf[256];
/* used by the MCTP stack */
- uint8_t tx_storage[MCTP_PKTBUF_SIZE(SERIAL_BTU)];
+ uint8_t tx_storage[MCTP_PKTBUF_SIZE(SERIAL_BTU)] PKTBUF_STORAGE_ALIGN;
};
#define binding_to_serial(b) \