summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_parser.py
diff options
context:
space:
mode:
authorQasim Ijaz <qasdev00@gmail.com>2025-04-22 16:37:37 +0100
committerXu Yilun <yilun.xu@linux.intel.com>2025-05-06 00:37:00 +0800
commit6ebf1982038af12f3588417e4fd0417d2551da28 (patch)
tree7cc8b61606368f572f08ca22da363f2e20ae34be /scripts/lib/kdoc/kdoc_parser.py
parent99b11851e5ed599c626d26834e57e3df2e31fffd (diff)
fpga: fix potential null pointer deref in fpga_mgr_test_img_load_sgt()
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 <marco.pagani@linux.dev> Fixes: ccbc1c302115 ("fpga: add an initial KUnit suite for the FPGA Manager") Signed-off-by: Qasim Ijaz <qasdev00@gmail.com> Acked-by: Xu Yilun <yilun.xu@intel.com> Link: https://lore.kernel.org/r/20250422153737.5264-1-qasdev00@gmail.com Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions