diff mbox

odp_linux.c:replace ODP_ERR with ODP_ABORT

Message ID 1412338893-47487-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 1e273a210cbf5a591633954b04b8ac8a12a5ca1f
Headers show

Commit Message

Mike Holmes Oct. 3, 2014, 12:21 p.m. UTC
The test for a NULL on the start_args pointer returned from malloc
only called ODP_ERR and so start_args is used when it is NULL

Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 platform/linux-generic/odp_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anders Roxell Oct. 6, 2014, 2:49 p.m. UTC | #1
On 2014-10-03 08:21, Mike Holmes wrote:
> The test for a NULL on the start_args pointer returned from malloc
> only called ODP_ERR and so start_args is used when it is NULL
> 
> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>

Reviewed-by: Anders Roxell <anders.roxell@linaro.org>

> ---
>  platform/linux-generic/odp_linux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/platform/linux-generic/odp_linux.c b/platform/linux-generic/odp_linux.c
> index 9251ec9..f5d5977 100644
> --- a/platform/linux-generic/odp_linux.c
> +++ b/platform/linux-generic/odp_linux.c
> @@ -75,7 +75,7 @@ void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num,
>  
>  		start_args = malloc(sizeof(odp_start_args_t));
>  		if (start_args == NULL)
> -			ODP_ERR("Malloc failed");
> +			ODP_ABORT("Malloc failed");
>  
>  		memset(start_args, 0, sizeof(odp_start_args_t));
>  		start_args->start_routine = start_routine;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
Maxim Uvarov Oct. 8, 2014, 5:03 p.m. UTC | #2
Applied!

Maxim.

On 10/06/2014 06:49 PM, Anders Roxell wrote:
> On 2014-10-03 08:21, Mike Holmes wrote:
>> The test for a NULL on the start_args pointer returned from malloc
>> only called ODP_ERR and so start_args is used when it is NULL
>>
>> Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> Reviewed-by: Anders Roxell <anders.roxell@linaro.org>
>
>> ---
>>   platform/linux-generic/odp_linux.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/platform/linux-generic/odp_linux.c b/platform/linux-generic/odp_linux.c
>> index 9251ec9..f5d5977 100644
>> --- a/platform/linux-generic/odp_linux.c
>> +++ b/platform/linux-generic/odp_linux.c
>> @@ -75,7 +75,7 @@ void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num,
>>   
>>   		start_args = malloc(sizeof(odp_start_args_t));
>>   		if (start_args == NULL)
>> -			ODP_ERR("Malloc failed");
>> +			ODP_ABORT("Malloc failed");
>>   
>>   		memset(start_args, 0, sizeof(odp_start_args_t));
>>   		start_args->start_routine = start_routine;
>> -- 
>> 1.9.1
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
diff mbox

Patch

diff --git a/platform/linux-generic/odp_linux.c b/platform/linux-generic/odp_linux.c
index 9251ec9..f5d5977 100644
--- a/platform/linux-generic/odp_linux.c
+++ b/platform/linux-generic/odp_linux.c
@@ -75,7 +75,7 @@  void odph_linux_pthread_create(odph_linux_pthread_t *thread_tbl, int num,
 
 		start_args = malloc(sizeof(odp_start_args_t));
 		if (start_args == NULL)
-			ODP_ERR("Malloc failed");
+			ODP_ABORT("Malloc failed");
 
 		memset(start_args, 0, sizeof(odp_start_args_t));
 		start_args->start_routine = start_routine;