From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] dev: don't remove devargs that are still referenced Date: Wed, 21 Nov 2018 19:55:00 +0100 Message-ID: <2837515.psv4tKiTEp@xps> References: <20181121183750.33796-1-dariusz.stojaczyk@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, gaetan.rivet@6wind.com To: Darek Stojaczyk Return-path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id C644A1B117 for ; Wed, 21 Nov 2018 19:55:03 +0100 (CET) In-Reply-To: <20181121183750.33796-1-dariusz.stojaczyk@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/11/2018 19:37, Darek Stojaczyk: > Even if a device failed to plug, it's still a device > object that references the devargs. Those devargs will > be freed automatically together with the device, but > can't be freed any earlier. Thanks for the patch. Please, be more specific about the bug. You could add 2 more paragraphs: - One before, to explain the tested scenario and the result. - One after, to explain how it is fixed (changing the goto by a return). [...] > ret = dev->bus->plug(dev); > if (ret) { > - if (rte_dev_is_probed(dev)) /* if already succeeded earlier */ > - return ret; /* no rollback */ > - RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n", > - dev->name); > - goto err_devarg; > + if (!rte_dev_is_probed(dev)) /* if hasn't succeeded earlier */ > + RTE_LOG(ERR, EAL, "Driver cannot attach the device (%s)\n", > + dev->name); > + return ret; > }