diff mbox

example: l3fwd: prevent possible use of uninitialised variables

Message ID 1477575728-24290-1-git-send-email-matias.elo@nokia.com
State Accepted
Commit cd472652f51881008020a5a56b1ffc774f813ac3
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) Oct. 27, 2016, 1:42 p.m. UTC
Fixes bug https://bugs.linaro.org/show_bug.cgi?id=2564

Signed-off-by: Matias Elo <matias.elo@nokia.com>

---
 example/l3fwd/odp_l3fwd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

-- 
2.7.4

Comments

Bill Fischofer Oct. 27, 2016, 2:04 p.m. UTC | #1
On Thu, Oct 27, 2016 at 8:42 AM, Matias Elo <matias.elo@nokia.com> wrote:

> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=2564

>

> Signed-off-by: Matias Elo <matias.elo@nokia.com>

>


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



> ---

>  example/l3fwd/odp_l3fwd.c | 4 +++-

>  1 file changed, 3 insertions(+), 1 deletion(-)

>

> diff --git a/example/l3fwd/odp_l3fwd.c b/example/l3fwd/odp_l3fwd.c

> index fa1b299..8919bd3 100644

> --- a/example/l3fwd/odp_l3fwd.c

> +++ b/example/l3fwd/odp_l3fwd.c

> @@ -309,7 +309,9 @@ static int run_worker(void *arg)

>                 }

>         }

>

> -       num_pktio = thr_arg->nb_pktio;

> +       if (num_pktio == 0)

> +               LOG_ABORT("No pktio devices found\n");

> +

>         if_idx = input_ifs[pktio];

>         inq = input_queues[pktio];

>

> --

> 2.7.4

>

>
Maxim Uvarov Oct. 28, 2016, 1:46 p.m. UTC | #2
Merged,
Maxim.

On 10/27/16 17:04, Bill Fischofer wrote:
> On Thu, Oct 27, 2016 at 8:42 AM, Matias Elo <matias.elo@nokia.com> wrote:

>

>> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=2564

>>

>> Signed-off-by: Matias Elo <matias.elo@nokia.com>

>>

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

>

>

>> ---

>>   example/l3fwd/odp_l3fwd.c | 4 +++-

>>   1 file changed, 3 insertions(+), 1 deletion(-)

>>

>> diff --git a/example/l3fwd/odp_l3fwd.c b/example/l3fwd/odp_l3fwd.c

>> index fa1b299..8919bd3 100644

>> --- a/example/l3fwd/odp_l3fwd.c

>> +++ b/example/l3fwd/odp_l3fwd.c

>> @@ -309,7 +309,9 @@ static int run_worker(void *arg)

>>                  }

>>          }

>>

>> -       num_pktio = thr_arg->nb_pktio;

>> +       if (num_pktio == 0)

>> +               LOG_ABORT("No pktio devices found\n");

>> +

>>          if_idx = input_ifs[pktio];

>>          inq = input_queues[pktio];

>>

>> --

>> 2.7.4

>>

>>
diff mbox

Patch

diff --git a/example/l3fwd/odp_l3fwd.c b/example/l3fwd/odp_l3fwd.c
index fa1b299..8919bd3 100644
--- a/example/l3fwd/odp_l3fwd.c
+++ b/example/l3fwd/odp_l3fwd.c
@@ -309,7 +309,9 @@  static int run_worker(void *arg)
 		}
 	}
 
-	num_pktio = thr_arg->nb_pktio;
+	if (num_pktio == 0)
+		LOG_ABORT("No pktio devices found\n");
+
 	if_idx = input_ifs[pktio];
 	inq = input_queues[pktio];