mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
fpga: xilinx: Check valid desc structure
FPGA validation can fail and return value needs to be checked. Addresses-Coverity-ID: CID 583150: Null pointer dereferences (NULL_RETURNS) Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/876b6f8dbc99ca305460183dbd18635a35ccc989.1753686468.git.michal.simek@amd.com
This commit is contained in:
@@ -50,6 +50,9 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
|
||||
dataptr = (unsigned char *)fpgadata;
|
||||
/* Find out fpga_description */
|
||||
desc = fpga_validate(devnum, dataptr, 0);
|
||||
if (!desc)
|
||||
return FPGA_FAIL;
|
||||
|
||||
/* Assign xilinx device description */
|
||||
xdesc = desc->devdesc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user