aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/tests/fpga-mgr-test.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'fpga-for-6.16-rc1' of ↵Greg Kroah-Hartman2025-05-211-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-next Xu writes: FPGA Manager changes for 6.16-rc1 - Peter hands over the maintain role of m10bmc-sec driver to Matthew. - Qasim's change fix potential NULL pointer for fpga test. All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-next branch). Signed-off-by: Xu Yilun <[email protected]> * tag 'fpga-for-6.16-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt() fpga: m10bmc-sec: change contact for secure update driver
| * fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()Qasim Ijaz2025-05-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fpga_mgr_test_img_load_sgt() allocates memory for sgt using kunit_kzalloc() however it does not check if the allocation failed. It then passes sgt to sg_alloc_table(), which passes it to __sg_alloc_table(). This function calls memset() on sgt in an attempt to zero it out. If the allocation fails then sgt will be NULL and the memset will trigger a NULL pointer dereference. Fix this by checking the allocation with KUNIT_ASSERT_NOT_ERR_OR_NULL(). Reviewed-by: Marco Pagani <[email protected]> Fixes: ccbc1c302115 ("fpga: add an initial KUnit suite for the FPGA Manager") Signed-off-by: Qasim Ijaz <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>
* | fpga: tests: add module descriptionsArnd Bergmann2025-04-121-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | Modules without a description now cause a warning: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-bridge-test.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-mgr-test.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/fpga/tests/fpga-region-test.o Link: https://lkml.kernel.org/r/[email protected] Fixes: 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()") Signed-off-by: Arnd Bergmann <[email protected]> Cc: Hao Wu <[email protected]> Cc: Jeff Johnson <[email protected]> Cc: Marco Pagani <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Moritz Fischer <[email protected]> Cc: Russ Weight <[email protected]> Cc: Stehen Rothwell <[email protected]> Cc: Tom Rix <[email protected]> Cc: Xu Yilun <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
* fpga: Simplify and improve fpga mgr test using deferred actionsMarco Pagani2024-08-141-11/+17
| | | | | | | | | | | | Use deferred actions to simplify the test suite and avoid potential memory leaks when test cases fail. Remove unnecessary calls to kunit_device_unregister() since kunit devices are tied to the test context and released by a deferred action when the test is completed. Signed-off-by: Marco Pagani <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>
* fpga: tests: use KUnit devices instead of platform devicesMarco Pagani2024-04-091-8/+8
| | | | | | | | | | | | | KUnit now provides helper functions to create fake devices, so use them instead of relying on platform devices. Other changes: remove an unnecessary white space in the fpga region suite. Reviewed-by: Russ Weight <[email protected]> Signed-off-by: Marco Pagani <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>
* fpga: add an initial KUnit suite for the FPGA ManagerMarco Pagani2023-07-231-0/+327
The suite tests the basic behaviors of the FPGA Manager including programming using a single contiguous buffer and a scatter gather table. Signed-off-by: Marco Pagani <[email protected]> Acked-by: Xu Yilun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Xu Yilun <[email protected]>