FPGA Manager changes for 6.0-final

Intel m10 bmc secure update
 
 - Russ's change fixes the memory leak for a sysfs node reading
 
 All patches have been reviewed on the mailing list, and have been in the
 last linux-next releases (as part of our for-6.0 branch).
 
 Signed-off-by: Xu Yilun <yilun.xu@intel.com>
 -----BEGIN PGP SIGNATURE-----
 
 iIkEABYIADEWIQSgSJpClIeaArXyudb8twOBpKCM2gUCYylUThMceWlsdW4ueHVA
 aW50ZWwuY29tAAoJEPy3A4GkoIzaiNUA/3KNKS+/to+4Mbm7d44CwDHKjyDLBXjv
 K13FE4ofqgskAP0Tl452unBAzOf1iGMA6fjA8eVAZ3djt2p50Foj9vfCAA==
 =TG/z
 -----END PGP SIGNATURE-----

Merge tag 'fpga-for-6.0-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-linus

Xu writes:

FPGA Manager changes for 6.0-final

Intel m10 bmc secure update

- Russ's change fixes the memory leak for a sysfs node reading

All patches have been reviewed on the mailing list, and have been in the
last linux-next releases (as part of our for-6.0 branch).

Signed-off-by: Xu Yilun <yilun.xu@intel.com>

* tag 'fpga-for-6.0-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga:
  fpga: m10bmc-sec: Fix possible memory leak of flash_buf
This commit is contained in:
Greg Kroah-Hartman 2022-09-21 15:26:45 +02:00
commit ab4bbde809
1 changed files with 4 additions and 4 deletions

View File

@ -148,10 +148,6 @@ static ssize_t flash_count_show(struct device *dev,
stride = regmap_get_reg_stride(sec->m10bmc->regmap);
num_bits = FLASH_COUNT_SIZE * 8;
flash_buf = kmalloc(FLASH_COUNT_SIZE, GFP_KERNEL);
if (!flash_buf)
return -ENOMEM;
if (FLASH_COUNT_SIZE % stride) {
dev_err(sec->dev,
"FLASH_COUNT_SIZE (0x%x) not aligned to stride (0x%x)\n",
@ -160,6 +156,10 @@ static ssize_t flash_count_show(struct device *dev,
return -EINVAL;
}
flash_buf = kmalloc(FLASH_COUNT_SIZE, GFP_KERNEL);
if (!flash_buf)
return -ENOMEM;
ret = regmap_bulk_read(sec->m10bmc->regmap, STAGING_FLASH_COUNT,
flash_buf, FLASH_COUNT_SIZE / stride);
if (ret) {