From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id DA618C328 for ; Tue, 4 Aug 2015 17:54:07 +0200 (CEST) Received: by wibud3 with SMTP id ud3so183350650wib.1 for ; Tue, 04 Aug 2015 08:54:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=vHbhJTqPnutBxUc6ScbGQ/QcV3qnsxm5jwRgc+zGlHg=; b=RuAzcda6Nv9aVufLErt06J1u9rv2RZefvamxMz/pVt0phyDmkqnf/yXJ0T6fFN1bdW AU1mGIxmFX2yIxpthY+SCLf2fYHO+62jM79hImwMsWze2myt35ITpA3MUip709cxR/9M 1puMUjsW/2NeEhcTE0pOha3mq+Wg4WYMS62BvmCWDc5yOMwvxwuOFXVkhMfDXc7xw63F GszG2oDi0vo6sSlomwF5DqdfHoQfqOihfeNPLZ8+Hfv1Onu/xYkkOyAhPXdkws4BGSfE RA/rVack9BPipGmr8lZvVEmGPuLIrSCgn7iLIyVnPUP6kKoo3a+XQB+vYNAHtELdMTUR 53mQ== X-Gm-Message-State: ALoCoQnOniDCVk4RVZrbCvgA0qDr1IYi4nV4bEaE6H7KedxLco0Hsf4Anp0PH65XpnvcX3YahQQE X-Received: by 10.194.121.34 with SMTP id lh2mr9402085wjb.101.1438703647655; Tue, 04 Aug 2015 08:54:07 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id fz16sm3057520wic.3.2015.08.04.08.54.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Aug 2015 08:54:06 -0700 (PDT) From: Thomas Monjalon To: Bernard Iremonger Date: Tue, 04 Aug 2015 17:52:51 +0200 Message-ID: <1572867.aSjIJySGWI@xps13> Organization: 6WIND User-Agent: KMail/4.14.8 (Linux/4.0.4-2-ARCH; KDE/4.14.8; x86_64; ; ) In-Reply-To: <1438701978-29248-1-git-send-email-bernard.iremonger@intel.com> References: <1438701978-29248-1-git-send-email-bernard.iremonger@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 1/1] bonding: fix error handling in rte_eth_bond_create() 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: Tue, 04 Aug 2015 15:54:08 -0000 2015-08-04 16:26, Bernard Iremonger: > if the name parameter to rte_eth_bond_create() was NULL, > there was a segmentation fault. What is the root cause of the crash? I guess it is rte_free(eth_dev->data->mac_addrs) because eth_dev is NULL. [...] > -err: > - rte_free(pci_dev); > - rte_free(internals); > +err4: > rte_free(eth_dev->data->mac_addrs); > - > +err3: > + rte_free(internals); > +err2: > + rte_free(pci_dev); > +err1: > return -1; > } rte_free should be harmless with NULL parameter. It is easier to add "if (eth_dev != NULL)" than maintaining many error labels. By the way, why rte_eth_dev_release_port() is not called?