wuxu.wu
2019-Dec-21 03:52 UTC
[Nouveau] [PATCH] drm/nouveau/bios: fix incorrect kfree in platform_init
priv porinter could be free only when priv != null and priv->rom is null. Signed-off-by: wuxu.wu <wuxu.wu at huawei.com> --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c index 9b91da0..d776e01 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowpci.c @@ -70,8 +70,9 @@ pcirom_init(struct nvkm_bios *bios, const char *name) (priv->rom = pci_map_rom(pdev, &priv->size))) { priv->pdev = pdev; return priv; + } else { + kfree(priv); } - kfree(priv); } pci_disable_rom(pdev); } -- 2.7.4
Seemingly Similar Threads
- [PATCH] drm/nouveau/bios: fix incorrect kfree in platform_init
- [PATCH] drm/nouveau/bios: fix incorrect kfree in platform_init
- [PATCH] drm/nouveau/bios: fix incorrect kfree in platform_init
- [PATCH AUTOSEL 5.5 121/121] PCI: Use ioremap(), not phys_to_virt() for platform ROM
- [PATCH AUTOSEL 5.6 149/149] PCI: Use ioremap(), not phys_to_virt() for platform ROM