[dpdk-stable] [dpdk-dev] [PATCH v2] sched: check newly allocated pointer
Min Hu (Connor)
humin29 at huawei.com
Mon May 24 14:14:46 CEST 2021
Hi, Thierry,
This bug has been fixed in my earlier patch, please refer to:
https://patches.dpdk.org/project/dpdk/patch/1619175672-20016-2-git-send-email-humin29@huawei.com/
Thanks.
在 2021/5/24 19:30, Thierry Herbelot 写道:
> Check port->subport_profiles after it was allocated.
>
> Fixes: 0ea4c6afcaf14 ("sched: add subport profile table")
> Cc: stable at dpdk.org
> Cc: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
> Cc: Jasvinder Singh <jasvinder.singh at intel.com>
>
> Signed-off-by: Thierry Herbelot <thierry.herbelot at 6wind.com>
> --
> V2: reword patch title
> ---
> lib/sched/rte_sched.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
> index cd87e688e489..4a2c0e27550d 100644
> --- a/lib/sched/rte_sched.c
> +++ b/lib/sched/rte_sched.c
> @@ -961,7 +961,7 @@ rte_sched_port_config(struct rte_sched_port_params *params)
> /* Allocate memory to store the subport profile */
> port->subport_profiles = rte_zmalloc_socket("subport_profile", size2,
> RTE_CACHE_LINE_SIZE, params->socket);
> - if (port == NULL) {
> + if (port->subport_profiles == NULL) {
> RTE_LOG(ERR, SCHED, "%s: Memory allocation fails\n", __func__);
>
> return NULL;
>
More information about the stable
mailing list