eal: fix core number validation
authorHari Kumar Vemula <hari.kumarx.vemula@intel.com>
Thu, 17 Jan 2019 12:13:12 +0000 (12:13 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 17 Jan 2019 16:22:04 +0000 (17:22 +0100)
commitb38693b612b4cabb7cb38a4eeb036285b2b55b0b
treef139bb0257a8c52e188782111ea71beab92016cb
parent05853e1784ab004a42451aebcbde22e0c732122a
eal: fix core number validation

When incorrect core value or range provided,
as part of -l command line option, a crash occurs.

Added valid range checks to fix the crash.

Added ut check for negative core values.
Added unit test case for invalid core number range.

Fixes: d888cb8b9613 ("eal: add core list input format")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_eal/common/eal_common_options.c
test/test/test_eal_flags.c