File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -598,8 +598,10 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
598
598
qcom -> dwc3 -> dev .coherent_dma_mask = dev -> coherent_dma_mask ;
599
599
600
600
child_res = kcalloc (2 , sizeof (* child_res ), GFP_KERNEL );
601
- if (!child_res )
601
+ if (!child_res ) {
602
+ platform_device_put (qcom -> dwc3 );
602
603
return - ENOMEM ;
604
+ }
603
605
604
606
res = platform_get_resource (pdev , IORESOURCE_MEM , 0 );
605
607
if (!res ) {
@@ -637,9 +639,13 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
637
639
if (ret ) {
638
640
dev_err (& pdev -> dev , "failed to add device\n" );
639
641
device_remove_software_node (& qcom -> dwc3 -> dev );
642
+ goto out ;
640
643
}
644
+ kfree (child_res );
645
+ return 0 ;
641
646
642
647
out :
648
+ platform_device_put (qcom -> dwc3 );
643
649
kfree (child_res );
644
650
return ret ;
645
651
}
You can’t perform that action at this time.
0 commit comments