examples/kni: print release error
authorDaniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Mon, 9 May 2016 09:38:30 +0000 (11:38 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 16 May 2016 12:48:09 +0000 (14:48 +0200)
In kni_free_kni: Value returned from a function is not checked for errors
before being used

Coverity issue: 30692
Fixes: b475eb0bc400 ("examples/kni: new parameters")

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
examples/kni/main.c

index a5297f2..0cf23e7 100644 (file)
@@ -831,7 +831,8 @@ kni_free_kni(uint8_t port_id)
                return -1;
 
        for (i = 0; i < p[port_id]->nb_kni; i++) {
-               rte_kni_release(p[port_id]->kni[i]);
+               if (rte_kni_release(p[port_id]->kni[i]))
+                       printf("Fail to release kni\n");
                p[port_id]->kni[i] = NULL;
        }
        rte_eth_dev_stop(port_id);