Commit aaa90d0
iio: test : check null return of kunit_kmalloc in iio_rescale_test_scale
kunit_kmalloc may fail, return value might be NULL and will cause
NULL pointer dereference.Add KUNIT_ASSERT_NOT_ERR_OR_NULL fix it.
Signed-off-by: Pei Xiao <[email protected]>
Fixes: 8e74a48 ("iio: test: add basic tests for the iio-rescale driver")
Link: https://patch.msgid.link/ecd56a85e54a96c2f0313c114075a21a76071ea2.1730259869.git.xiaopei01@kylinos.cn
Signed-off-by: Jonathan Cameron <[email protected]>1 parent 4be339a commit aaa90d0
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
| 656 | + | |
655 | 657 | | |
656 | 658 | | |
657 | 659 | | |
| |||
681 | 683 | | |
682 | 684 | | |
683 | 685 | | |
| 686 | + | |
| 687 | + | |
684 | 688 | | |
685 | 689 | | |
686 | 690 | | |
| |||
0 commit comments