[dpdk-dev] [PATCH v3 3/9] mem: fix potential double close

Bruce Richardson bruce.richardson at intel.com
Fri Apr 27 17:15:54 CEST 2018


On Wed, Apr 25, 2018 at 10:56:41AM +0100, Anatoly Burakov wrote:
> We were closing descriptor before checking if mapping has
> failed, but if it did, we did a second close afterwards. Fix
> it by moving closing descriptor to after we check if mmap has
> succeeded.
> 
> Coverity issue: 272560
> 
> Fixes: 2a04139f66b4 ("eal: add single file segments option")
> Cc: anatoly.burakov at intel.com
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> ---
Is a better fix not to assign fd to -1 after closing and then checking that
in the error leg?


More information about the dev mailing list