1acc43383c
This patch fixes following memory leaks. - When open() is failed, uio_res and fds won't be freed in pci_uio_map_resource(). - When pci_map_resource() is failed but path is allocated correctly, path and fds won't be freed in pci_uio_map_recource(). Also, some mapped resources should be freed. - When pci_uio_unmap() is called, path should be freed. Also, fixes below. - When pci_map_resource() is failed, mapaddr will be MAP_FAILED. In this case, pci_map_addr should not be incremented in pci_uio_map_resource(). - To shrink code, move close(). - Remove fail variable. Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com> Acked-by: David Marchand <david.marchand@6wind.com>