diff mbox

[PATCHv2] linux-generic: tm: init pthread attrs

Message ID 1464678357-9455-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 7233eed2e66b9f5d2abccd0f96ecce8675c764ae
Headers show

Commit Message

Maxim Uvarov May 31, 2016, 7:05 a.m. UTC
Fix segmentation failt with not initialized attr for pthreads.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_traffic_mngr.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bill Fischofer May 31, 2016, 11:30 a.m. UTC | #1
On Tue, May 31, 2016 at 2:05 AM, Maxim Uvarov <maxim.uvarov@linaro.org>
wrote:

> Fix segmentation failt with not initialized attr for pthreads.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>


> ---
>  platform/linux-generic/odp_traffic_mngr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/platform/linux-generic/odp_traffic_mngr.c
> b/platform/linux-generic/odp_traffic_mngr.c
> index 0b37142..fb18ab3 100644
> --- a/platform/linux-generic/odp_traffic_mngr.c
> +++ b/platform/linux-generic/odp_traffic_mngr.c
> @@ -2551,6 +2551,7 @@ static int tm_thread_create(tm_system_t *tm_system)
>         uint32_t       cpu_num;
>         int            rc;
>
> +       pthread_attr_init(&attr);
>         cpu_num = tm_thread_cpu_select();
>         CPU_ZERO(&cpu_set);
>         CPU_SET(cpu_num, &cpu_set);
> --
> 2.7.1.250.gff4ea60
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Maxim Uvarov May 31, 2016, 1:45 p.m. UTC | #2
Merged,
Maxim.

On 05/31/16 14:30, Bill Fischofer wrote:
>
>
> On Tue, May 31, 2016 at 2:05 AM, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Fix segmentation failt with not initialized attr for pthreads.
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org 
> <mailto:bill.fischofer@linaro.org>>
>
>     ---
>      platform/linux-generic/odp_traffic_mngr.c | 1 +
>      1 file changed, 1 insertion(+)
>
>     diff --git a/platform/linux-generic/odp_traffic_mngr.c
>     b/platform/linux-generic/odp_traffic_mngr.c
>     index 0b37142..fb18ab3 100644
>     --- a/platform/linux-generic/odp_traffic_mngr.c
>     +++ b/platform/linux-generic/odp_traffic_mngr.c
>     @@ -2551,6 +2551,7 @@ static int tm_thread_create(tm_system_t
>     *tm_system)
>             uint32_t       cpu_num;
>             int            rc;
>
>     +       pthread_attr_init(&attr);
>             cpu_num = tm_thread_cpu_select();
>             CPU_ZERO(&cpu_set);
>             CPU_SET(cpu_num, &cpu_set);
>     --
>     2.7.1.250.gff4ea60
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c
index 0b37142..fb18ab3 100644
--- a/platform/linux-generic/odp_traffic_mngr.c
+++ b/platform/linux-generic/odp_traffic_mngr.c
@@ -2551,6 +2551,7 @@  static int tm_thread_create(tm_system_t *tm_system)
 	uint32_t       cpu_num;
 	int            rc;
 
+	pthread_attr_init(&attr);
 	cpu_num = tm_thread_cpu_select();
 	CPU_ZERO(&cpu_set);
 	CPU_SET(cpu_num, &cpu_set);