net: mctp: usblib: Simplify allocation logic in mctp_usblib_test_rx_init

The if statement testing rx's allocation is unneeded.

Signed-off-by: James Lee <james@codeconstruct.com.au>
Link: https://patch.msgid.link/20261014-dev-mctp-usb-lib-test-v3-5-ee5bc3ea1db1@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
James Lee 2026-10-14 12:47:35 +08:00 committed by Jakub Kicinski
parent 40e59c00ae
commit 77cb5c6b34

View File

@ -202,11 +202,9 @@ mctp_usblib_test_rx_init(struct kunit *test, bool span)
int rc;
rx = kzalloc_obj(*rx);
if (rx) {
rc = kunit_add_action_or_reset(test, action_rx_fini, rx);
KUNIT_ASSERT_EQ(test, rc, 0);
}
KUNIT_ASSERT_NOT_NULL(test, rx);
rc = kunit_add_action_or_reset(test, action_rx_fini, rx);
KUNIT_ASSERT_EQ(test, rc, 0);
rc = mctp_usblib_rx_init(rx, ep_maxpacket, span);
KUNIT_ASSERT_EQ(test, rc, 0);