mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
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:
parent
40e59c00ae
commit
77cb5c6b34
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user