Commit 435c20e
kunit: Fix potential null dereference in kunit_device_driver_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.
Link: https://lore.kernel.org/r/[email protected]
Fixes: d03c720 ("kunit: Add APIs for managing devices")
Signed-off-by: Zichen Xie <[email protected]>
Cc: [email protected]
Reviewed-by: David Gow <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>1 parent aadf9cb commit 435c20e
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
| 808 | + | |
| 809 | + | |
808 | 810 | | |
809 | 811 | | |
810 | 812 | | |
| |||
0 commit comments