virt: sev-guest: Pass the appropriate argument type to iounmap()
Fix a sparse warning in sev_guest_probe() where the wrong argument type is
provided to iounmap().
Fixes: fce96cf044
("virt: Add SEV-SNP guest driver")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/202207150617.jqwQ0Rpz-lkp@intel.com
This commit is contained in:
parent
28a99e95f5
commit
908fc4c2ab
@ -632,16 +632,19 @@ static int __init sev_guest_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct snp_guest_dev *snp_dev;
|
struct snp_guest_dev *snp_dev;
|
||||||
struct miscdevice *misc;
|
struct miscdevice *misc;
|
||||||
|
void __iomem *mapping;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!dev->platform_data)
|
if (!dev->platform_data)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
data = (struct sev_guest_platform_data *)dev->platform_data;
|
data = (struct sev_guest_platform_data *)dev->platform_data;
|
||||||
layout = (__force void *)ioremap_encrypted(data->secrets_gpa, PAGE_SIZE);
|
mapping = ioremap_encrypted(data->secrets_gpa, PAGE_SIZE);
|
||||||
if (!layout)
|
if (!mapping)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
layout = (__force void *)mapping;
|
||||||
|
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
snp_dev = devm_kzalloc(&pdev->dev, sizeof(struct snp_guest_dev), GFP_KERNEL);
|
snp_dev = devm_kzalloc(&pdev->dev, sizeof(struct snp_guest_dev), GFP_KERNEL);
|
||||||
if (!snp_dev)
|
if (!snp_dev)
|
||||||
@ -706,7 +709,7 @@ e_free_response:
|
|||||||
e_free_request:
|
e_free_request:
|
||||||
free_shared_pages(snp_dev->request, sizeof(struct snp_guest_msg));
|
free_shared_pages(snp_dev->request, sizeof(struct snp_guest_msg));
|
||||||
e_unmap:
|
e_unmap:
|
||||||
iounmap(layout);
|
iounmap(mapping);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user