Check return value of fseek and exit if non zero.
Coverity issue: 143435
Fixes:
bab16ddaf2c1 ("examples/flow_classify: add sample application")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
unsigned int i = 0;
unsigned int total_num = 0;
struct rte_eth_ntuple_filter ntuple_filter;
unsigned int i = 0;
unsigned int total_num = 0;
struct rte_eth_ntuple_filter ntuple_filter;
fh = fopen(rule_path, "rb");
if (fh == NULL)
fh = fopen(rule_path, "rb");
if (fh == NULL)
- rte_exit(EXIT_FAILURE, "%s: Open %s failed\n", __func__,
+ rte_exit(EXIT_FAILURE, "%s: fopen %s failed\n", __func__,
- fseek(fh, 0, SEEK_SET);
+ ret = fseek(fh, 0, SEEK_SET);
+ if (ret)
+ rte_exit(EXIT_FAILURE, "%s: fseek %d failed\n", __func__,
+ ret);
i = 0;
while (fgets(buff, LINE_MAX, fh) != NULL) {
i = 0;
while (fgets(buff, LINE_MAX, fh) != NULL) {