Date: Wed, 12 Dec 2018 12:06:25 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341926 - stable/11/sys/dev/mlx5/mlx5_core Message-ID: <201812121206.wBCC6PPG069420@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Dec 12 12:06:25 2018 New Revision: 341926 URL: https://svnweb.freebsd.org/changeset/base/341926 Log: MFC r341556: mlx5: Fix for potential memory leaks. Make sure allocated data gets freed in error cases. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Wed Dec 12 12:06:20 2018 (r341925) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c Wed Dec 12 12:06:25 2018 (r341926) @@ -1601,9 +1601,10 @@ static char *get_dest_name(struct mlx5_flow_destinatio case MLX5_FLOW_CONTEXT_DEST_TYPE_TIR: snprintf(name, 20, "dest_%s_%u", "tir", dest->tir_num); return name; + default: + kfree(name); + return NULL; } - - return NULL; } /* assumed fg is locked */ Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Wed Dec 12 12:06:20 2018 (r341925) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Wed Dec 12 12:06:25 2018 (r341926) @@ -153,6 +153,7 @@ failure: bus_dmamem_free(dev->cmd.dma_tag, fwp[x].virt_addr, fwp[x].dma_map); } sx_xunlock(&dev->cmd.dma_sx); + kfree(fwp); return (NULL); } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Wed Dec 12 12:06:20 2018 (r341925) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c Wed Dec 12 12:06:25 2018 (r341926) @@ -1597,8 +1597,8 @@ int mlx5_query_vport_counter(struct mlx5_core_dev *dev err = mlx5_cmd_exec(dev, in, in_sz, out, out_size); - kvfree(in); ex: + kvfree(in); return err; } EXPORT_SYMBOL_GPL(mlx5_query_vport_counter);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121206.wBCC6PPG069420>