* [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer
@ 2021-05-24 8:57 Thierry Herbelot
2021-05-24 11:28 ` Dumitrescu, Cristian
2021-05-24 11:30 ` [dpdk-dev] [PATCH v2] sched: " Thierry Herbelot
0 siblings, 2 replies; 5+ messages in thread
From: Thierry Herbelot @ 2021-05-24 8:57 UTC (permalink / raw)
To: dev
Cc: Thierry Herbelot, Thomas Monjalon, stable, Cristian Dumitrescu,
Jasvinder Singh
Check port->subport_profiles after it was allocated.
Fixes: 0ea4c6afcaf14 ("sched: add subport profile table")
Cc: stable@dpdk.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
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;
--
2.29.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer
2021-05-24 8:57 [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer Thierry Herbelot
@ 2021-05-24 11:28 ` Dumitrescu, Cristian
2021-05-24 11:30 ` [dpdk-dev] [PATCH v2] sched: " Thierry Herbelot
1 sibling, 0 replies; 5+ messages in thread
From: Dumitrescu, Cristian @ 2021-05-24 11:28 UTC (permalink / raw)
To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, stable, Singh, Jasvinder
> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Monday, May 24, 2021 9:58 AM
> To: dev@dpdk.org
> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
> <thomas@monjalon.net>; stable@dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Subject: [PATCH] rte_sched: check newly allocated pointer
>
> Check port->subport_profiles after it was allocated.
>
> Fixes: 0ea4c6afcaf14 ("sched: add subport profile table")
> Cc: stable@dpdk.org
> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Cc: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> ---
> 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;
> --
> 2.29.2
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Thanks very much, Thierry!
It would be great though if you could send V2 with "sched" instead of "rte_sched" in the title:
[PATCH V2] sched: check newly allocated pointer
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] sched: check newly allocated pointer
2021-05-24 8:57 [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer Thierry Herbelot
2021-05-24 11:28 ` Dumitrescu, Cristian
@ 2021-05-24 11:30 ` Thierry Herbelot
2021-05-24 11:31 ` Dumitrescu, Cristian
2021-05-24 12:14 ` Min Hu (Connor)
1 sibling, 2 replies; 5+ messages in thread
From: Thierry Herbelot @ 2021-05-24 11:30 UTC (permalink / raw)
To: dev
Cc: Thierry Herbelot, Thomas Monjalon, stable, Cristian Dumitrescu,
Jasvinder Singh
Check port->subport_profiles after it was allocated.
Fixes: 0ea4c6afcaf14 ("sched: add subport profile table")
Cc: stable@dpdk.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Thierry Herbelot <thierry.herbelot@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;
--
2.29.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] sched: check newly allocated pointer
2021-05-24 11:30 ` [dpdk-dev] [PATCH v2] sched: " Thierry Herbelot
@ 2021-05-24 11:31 ` Dumitrescu, Cristian
2021-05-24 12:14 ` Min Hu (Connor)
1 sibling, 0 replies; 5+ messages in thread
From: Dumitrescu, Cristian @ 2021-05-24 11:31 UTC (permalink / raw)
To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, stable, Singh, Jasvinder
> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Monday, May 24, 2021 12:30 PM
> To: dev@dpdk.org
> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
> <thomas@monjalon.net>; stable@dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Singh, Jasvinder
> <jasvinder.singh@intel.com>
> Subject: [PATCH v2] sched: check newly allocated pointer
>
> Check port->subport_profiles after it was allocated.
>
> Fixes: 0ea4c6afcaf14 ("sched: add subport profile table")
> Cc: stable@dpdk.org
> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Cc: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Signed-off-by: Thierry Herbelot <thierry.herbelot@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;
> --
> 2.29.2
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] sched: check newly allocated pointer
2021-05-24 11:30 ` [dpdk-dev] [PATCH v2] sched: " Thierry Herbelot
2021-05-24 11:31 ` Dumitrescu, Cristian
@ 2021-05-24 12:14 ` Min Hu (Connor)
1 sibling, 0 replies; 5+ messages in thread
From: Min Hu (Connor) @ 2021-05-24 12:14 UTC (permalink / raw)
To: Thierry Herbelot, dev
Cc: Thomas Monjalon, stable, Cristian Dumitrescu, Jasvinder Singh
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@dpdk.org
> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Cc: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Signed-off-by: Thierry Herbelot <thierry.herbelot@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;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-05-24 12:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 8:57 [dpdk-dev] [PATCH] rte_sched: check newly allocated pointer Thierry Herbelot
2021-05-24 11:28 ` Dumitrescu, Cristian
2021-05-24 11:30 ` [dpdk-dev] [PATCH v2] sched: " Thierry Herbelot
2021-05-24 11:31 ` Dumitrescu, Cristian
2021-05-24 12:14 ` Min Hu (Connor)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).