aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/remoteproc/remoteproc_core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 92a1037c1b2e..3da566b0d437 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -847,14 +847,14 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
847 ret = rproc_handle_resources(rproc, tablesz, rproc_loading_handlers); 847 ret = rproc_handle_resources(rproc, tablesz, rproc_loading_handlers);
848 if (ret) { 848 if (ret) {
849 dev_err(dev, "Failed to process resources: %d\n", ret); 849 dev_err(dev, "Failed to process resources: %d\n", ret);
850 goto clean_up; 850 goto clean_up_resources;
851 } 851 }
852 852
853 /* load the ELF segments to memory */ 853 /* load the ELF segments to memory */
854 ret = rproc_load_segments(rproc, fw); 854 ret = rproc_load_segments(rproc, fw);
855 if (ret) { 855 if (ret) {
856 dev_err(dev, "Failed to load program segments: %d\n", ret); 856 dev_err(dev, "Failed to load program segments: %d\n", ret);
857 goto clean_up; 857 goto clean_up_resources;
858 } 858 }
859 859
860 /* 860 /*
@@ -875,7 +875,7 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
875 ret = rproc->ops->start(rproc); 875 ret = rproc->ops->start(rproc);
876 if (ret) { 876 if (ret) {
877 dev_err(dev, "can't start rproc %s: %d\n", rproc->name, ret); 877 dev_err(dev, "can't start rproc %s: %d\n", rproc->name, ret);
878 goto clean_up; 878 goto clean_up_resources;
879 } 879 }
880 880
881 rproc->state = RPROC_RUNNING; 881 rproc->state = RPROC_RUNNING;
@@ -884,12 +884,13 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
884 884
885 return 0; 885 return 0;
886 886
887clean_up_resources:
888 rproc_resource_cleanup(rproc);
887clean_up: 889clean_up:
888 kfree(rproc->cached_table); 890 kfree(rproc->cached_table);
889 rproc->cached_table = NULL; 891 rproc->cached_table = NULL;
890 rproc->table_ptr = NULL; 892 rproc->table_ptr = NULL;
891 893
892 rproc_resource_cleanup(rproc);
893 rproc_disable_iommu(rproc); 894 rproc_disable_iommu(rproc);
894 return ret; 895 return ret;
895} 896}