Skip to content
Unverified Commit 468c9d92 authored by Russ Weight's avatar Russ Weight Committed by Xu Yilun
Browse files

fpga: m10bmc-sec: Fix possible memory leak of flash_buf



There is an error check following the allocation of flash_buf that returns
without freeing flash_buf. It makes more sense to do the error check
before the allocation and the reordering eliminates the memory leak.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: 154afa5c ("fpga: m10bmc-sec: expose max10 flash update count")
Signed-off-by: default avatarRuss Weight <russell.h.weight@intel.com>
Reviewed-by: default avatarTom Rix <trix@redhat.com>
Acked-by: default avatarXu Yilun <yilun.xu@intel.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20220916235205.106873-1-russell.h.weight@intel.com


Signed-off-by: default avatarXu Yilun <yilun.xu@intel.com>
parent 568035b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment