]> www.infradead.org Git - users/dwmw2/linux.git/commit
firewire: test: Fix potential null dereference in firewire kunit test
authorCharles Han <hanchunchao@inspur.com>
Fri, 10 Jan 2025 08:42:37 +0000 (16:42 +0800)
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 13 Jan 2025 01:31:27 +0000 (10:31 +0900)
commit352fafe97784e81a10a7c74bd508f71a19b53c2a
tree3d20775021fdb8d5a47fa35a763300ce5f428b8e
parent892bb0740b02e9cc1e4e28b9fc042d5987257bef
firewire: test: Fix potential null dereference in firewire kunit test

kunit_kzalloc() may return a NULL pointer, dereferencing it without
NULL check may lead to NULL dereference.
Add a NULL check for test_state.

Fixes: 1c8506d62624 ("firewire: test: add test of device attributes for simple AV/C device")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Link: https://lore.kernel.org/r/20250110084237.8877-1-hanchunchao@inspur.com
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
drivers/firewire/device-attribute-test.c