mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	mailbox: pcc: Put the PCCT table for error path
The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping. In acpi_pcc_probe(), the PCCT table entries will be used as private data for communication chan at runtime, but the table should be put for error path. Signed-off-by: Hanjun Guo <guohanjun@huawei.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
This commit is contained in:
		
							parent
							
								
									c3917df54c
								
							
						
					
					
						commit
						425ab03675
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -457,14 +457,17 @@ static int __init acpi_pcc_probe(void)
 | 
				
			||||||
			pr_warn("Error parsing PCC subspaces from PCCT\n");
 | 
								pr_warn("Error parsing PCC subspaces from PCCT\n");
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			pr_warn("Invalid PCCT: %d PCC subspaces\n", count);
 | 
								pr_warn("Invalid PCCT: %d PCC subspaces\n", count);
 | 
				
			||||||
		return -EINVAL;
 | 
					
 | 
				
			||||||
 | 
							rc = -EINVAL;
 | 
				
			||||||
 | 
							goto err_put_pcct;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan),
 | 
						pcc_mbox_channels = kcalloc(count, sizeof(struct mbox_chan),
 | 
				
			||||||
				    GFP_KERNEL);
 | 
									    GFP_KERNEL);
 | 
				
			||||||
	if (!pcc_mbox_channels) {
 | 
						if (!pcc_mbox_channels) {
 | 
				
			||||||
		pr_err("Could not allocate space for PCC mbox channels\n");
 | 
							pr_err("Could not allocate space for PCC mbox channels\n");
 | 
				
			||||||
		return -ENOMEM;
 | 
							rc = -ENOMEM;
 | 
				
			||||||
 | 
							goto err_put_pcct;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
 | 
						pcc_doorbell_vaddr = kcalloc(count, sizeof(void *), GFP_KERNEL);
 | 
				
			||||||
| 
						 | 
					@ -535,6 +538,8 @@ static int __init acpi_pcc_probe(void)
 | 
				
			||||||
	kfree(pcc_doorbell_vaddr);
 | 
						kfree(pcc_doorbell_vaddr);
 | 
				
			||||||
err_free_mbox:
 | 
					err_free_mbox:
 | 
				
			||||||
	kfree(pcc_mbox_channels);
 | 
						kfree(pcc_mbox_channels);
 | 
				
			||||||
 | 
					err_put_pcct:
 | 
				
			||||||
 | 
						acpi_put_table(pcct_tbl);
 | 
				
			||||||
	return rc;
 | 
						return rc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue