File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
components/drivers/pci/host/dw Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ void dw_pcie_free_msi(struct dw_pcie_port *port)
204
204
205
205
rt_dma_free_coherent (pci -> dev , sizeof (rt_uint64_t ), port -> msi_data ,
206
206
port -> msi_data_phy );
207
+ port -> msi_data = RT_NULL ;
207
208
}
208
209
}
209
210
@@ -331,7 +332,8 @@ rt_err_t dw_pcie_host_init(struct dw_pcie_port *port)
331
332
{
332
333
LOG_E ("Invalid count of irq = %d" , port -> irq_count );
333
334
334
- return - RT_EINVAL ;
335
+ err = - RT_EINVAL ;
336
+ goto _err_free_cfg ;
335
337
}
336
338
}
337
339
@@ -341,7 +343,8 @@ rt_err_t dw_pcie_host_init(struct dw_pcie_port *port)
341
343
342
344
if (!port -> msi_pic )
343
345
{
344
- return - RT_ENOMEM ;
346
+ err = - RT_ENOMEM ;
347
+ goto _err_free_cfg ;
345
348
}
346
349
347
350
port -> msi_pic -> priv_data = port ;
@@ -404,6 +407,13 @@ rt_err_t dw_pcie_host_init(struct dw_pcie_port *port)
404
407
rt_pci_host_bridge_free (bridge );
405
408
port -> bridge = RT_NULL ;
406
409
410
+ _err_free_cfg :
411
+ if (port -> cfg0_base )
412
+ {
413
+ rt_iounmap (port -> cfg0_base );
414
+ port -> cfg0_base = RT_NULL ;
415
+ }
416
+
407
417
return err ;
408
418
}
409
419
You can’t perform that action at this time.
0 commit comments