From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 51EF62188F; Wed, 21 Nov 2018 13:55:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 21 Nov 2018 13:55:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=bVEkleZJj94+te2S3vLQhznApqcvhEReI5g6DdnUzaE=; b=rfzgPiBf8XCN eGbIXfFFkP22bWAvwgd/iG/joZfy8IYawHWOEglEd/AUN62BG2AseMERwGSR26Hb MfUhlIp+25WP/youRdQlnM5EcvTIx5Wcw4scMTlR+/IIokcebz4KLEu1pks7M1Zi j7g1k6b1yWBfbz4NJXVmzB3+s3J3q8g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=bVEkleZJj94+te2S3vLQhznApqcvhEReI5g6DdnUz aE=; b=kKB2Op0KHXgzxKCheW7EYYS2cf7XTg5YHi0LZN1r/bK23BEtoNUAnciSU calYGzo8dMGYeI4AxWI0Po+Z9kzaXgAiM4A77lVt7M8EDw53q9AZnuwPA/LjdGRj j5zs5UgFwUHEqkNhOXuUwmp3qwlx5S96fAZFuUCZA5zEGzBo1m2FZaOsGhsaIVyW vYB/RpsHJvCSR/R8EVrdTOCiYqZkKpotG3eJLLZheZGFrtxeTtpvnUuMJZCRTKcf wuiNRokSs7gfxwwmIW52WGaKExW+QlZ9zOx62wOrQYh0U7kqgFWgSnYJLqUrIjug 01wUxxZxITepZ4mO2m1dDHyU4uNxQ== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 14B5AE46B7; Wed, 21 Nov 2018 13:55:01 -0500 (EST) From: Thomas Monjalon To: Darek Stojaczyk Cc: dev@dpdk.org, gaetan.rivet@6wind.com Date: Wed, 21 Nov 2018 19:55:00 +0100 Message-ID: <2837515.psv4tKiTEp@xps> In-Reply-To: <20181121183750.33796-1-dariusz.stojaczyk@intel.com> References: <20181121183750.33796-1-dariusz.stojaczyk@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] dev: don't remove devargs that are still referenced X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:55:04 -0000 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; > }