[dpdk-dev] [PATCH v7 03/12] eal: Fix memory leaks and needless increment of pci_map_addr

Iremonger, Bernard bernard.iremonger at intel.com
Tue Jun 30 14:33:27 CEST 2015


> -----Original Message-----
> From: Tetsuya Mukawa [mailto:mukawa at igel.co.jp]
> Sent: Tuesday, June 30, 2015 9:24 AM
> To: dev at dpdk.org
> Cc: Iremonger, Bernard; david.marchand at 6wind.com; Richardson, Bruce;
> Tetsuya.Mukawa
> Subject: [PATCH v7 03/12] eal: Fix memory leaks and needless increment of
> pci_map_addr
> 
> From: "Tetsuya.Mukawa" <mukawa at igel.co.jp>
> 
> 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 at igel.co.jp>
Acked-by:  Bernard Iremonger <Bernard.iremonger at intel.com>



More information about the dev mailing list