Skip to content

Commit bf29ce8

Browse files
committed
Merge tag 'fpga-for-6.2-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga into char-misc-linus
Xy writes: FPGA Manager changes for 6.2-final stratix10-soc: - Zheng's change fixes return value check Intel m10 bmc secure update: - Ilpo's change fixes probe rollback All patches have been reviewed on the mailing list, and have been in the last linux-next releases (as part of our for-6.2 branch) Signed-off-by: Xu Yilun <[email protected]> * tag 'fpga-for-6.2-final' of git://git.kernel.org/pub/scm/linux/kernel/git/fpga/linux-fpga: fpga: m10bmc-sec: Fix probe rollback fpga: stratix10-soc: Fix return value check in s10_ops_write_init()
2 parents 1ca7fca + 60ce26d commit bf29ce8

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

drivers/fpga/intel-m10-bmc-sec-update.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -574,20 +574,27 @@ static int m10bmc_sec_probe(struct platform_device *pdev)
574574
len = scnprintf(buf, SEC_UPDATE_LEN_MAX, "secure-update%d",
575575
sec->fw_name_id);
576576
sec->fw_name = kmemdup_nul(buf, len, GFP_KERNEL);
577-
if (!sec->fw_name)
578-
return -ENOMEM;
577+
if (!sec->fw_name) {
578+
ret = -ENOMEM;
579+
goto fw_name_fail;
580+
}
579581

580582
fwl = firmware_upload_register(THIS_MODULE, sec->dev, sec->fw_name,
581583
&m10bmc_ops, sec);
582584
if (IS_ERR(fwl)) {
583585
dev_err(sec->dev, "Firmware Upload driver failed to start\n");
584-
kfree(sec->fw_name);
585-
xa_erase(&fw_upload_xa, sec->fw_name_id);
586-
return PTR_ERR(fwl);
586+
ret = PTR_ERR(fwl);
587+
goto fw_uploader_fail;
587588
}
588589

589590
sec->fwl = fwl;
590591
return 0;
592+
593+
fw_uploader_fail:
594+
kfree(sec->fw_name);
595+
fw_name_fail:
596+
xa_erase(&fw_upload_xa, sec->fw_name_id);
597+
return ret;
591598
}
592599

593600
static int m10bmc_sec_remove(struct platform_device *pdev)

drivers/fpga/stratix10-soc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ static int s10_ops_write_init(struct fpga_manager *mgr,
213213
/* Allocate buffers from the service layer's pool. */
214214
for (i = 0; i < NUM_SVC_BUFS; i++) {
215215
kbuf = stratix10_svc_allocate_memory(priv->chan, SVC_BUF_SIZE);
216-
if (!kbuf) {
216+
if (IS_ERR(kbuf)) {
217217
s10_free_buffers(mgr);
218-
ret = -ENOMEM;
218+
ret = PTR_ERR(kbuf);
219219
goto init_done;
220220
}
221221

0 commit comments

Comments
 (0)