From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 9DD08378E for ; Wed, 5 Aug 2015 23:58:20 +0200 (CEST) Received: by pawu10 with SMTP id u10so45570219paw.1 for ; Wed, 05 Aug 2015 14:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wyrKmXA7Rc9HwHOw8h4Ot8yFXbrgYKAgM3k0uik9KFQ=; b=Q4S5WwDfYwSjaim5vqG8G6ag50GqDO3SSK7kL4F3K0tk4ocPEQ/vtRadMiq39oTTD7 jhvwcDLWoPoA8U99Y5CAHKDeFIG3EumQQbXfz8Mbh2D5EEO4IWVEsda4q+UIVZQINSGr sFPpNT7NwFSu5HxZyKeobp/wwG2RpJBjamd6KDuPwKDZwTQVga35/M9rTcDnHxPDJCp0 0IILwULLkAxbRISFPETRuitJq2h/KB8AB7iSChDp3cnHfBqb5oA+i7y4d3vXkGf7Sr8S q1MRfAqN30wZMGmBPGVbYXkNfnIgy6i0Uo+SeM75ZxxKCYTXtlyxbf3inPDR/AC4IhuT azSw== X-Received: by 10.68.203.42 with SMTP id kn10mr24009961pbc.43.1438811899805; Wed, 05 Aug 2015 14:58:19 -0700 (PDT) Received: from localhost.localdomain ([58.143.71.2]) by smtp.gmail.com with ESMTPSA id oe7sm3980495pbb.66.2015.08.05.14.58.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 05 Aug 2015 14:58:19 -0700 (PDT) From: Hyun Yoo To: Helin Zhang Date: Wed, 5 Aug 2015 14:58:04 -0700 Message-Id: <1438811889-7439-1-git-send-email-easetheworld@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] examples/kni: Fix segmentation fault at program exit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2015 21:58:20 -0000 In kni_free_kni(), p[i] should be p[port_id] Signed-off-by: Hyun Yoo gmail.com> --- examples/kni/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index 6f74d8e..6d434ad 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -830,9 +830,9 @@ kni_free_kni(uint8_t port_id) if (port_id >= RTE_MAX_ETHPORTS || !p[port_id]) return -1; - for (i = 0; i < p[i]->nb_kni; i++) { - rte_kni_release(p[i]->kni[i]); - p[i]->kni[i] = NULL; + for (i = 0; i < p[port_id]->nb_kni; i++) { + rte_kni_release(p[port_id]->kni[i]); + p[port_id]->kni[i] = NULL; } rte_eth_dev_stop(port_id); -- 1.9.1