From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D3BDA0508; Thu, 14 Apr 2022 13:28:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0326440687; Thu, 14 Apr 2022 13:28:32 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C6E8940041 for ; Thu, 14 Apr 2022 13:28:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649935709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6UHcsGxm0isJUHeh+yez922XJva7DuTgTnh8cjeofiQ=; b=AAFa3gsN8EMlDCJ71WXWpNfWXQV+cpN7iLsPufWggTiedvrCiUN7dwWVIQmlx7FRblS2C5 I/pRWEnf73PQG/EUNMzt9jMBS8mu1NUvwArp111WCVG0HQt6uwHc+NVFINKgJVIBj28iA1 IAb/4y4kz3LExe90smiJ8PoBURom5/I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-264-CCORzuAEMhWRFVSymioluQ-1; Thu, 14 Apr 2022 07:28:26 -0400 X-MC-Unique: CCORzuAEMhWRFVSymioluQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 10AAA800B21; Thu, 14 Apr 2022 11:28:26 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA28C407F787; Thu, 14 Apr 2022 11:28:24 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Xueming Li , Ray Kinsella , Gaetan Rivet Subject: [PATCH] devargs: fix leak on hotplug failure Date: Thu, 14 Apr 2022 13:27:56 +0200 Message-Id: <20220414112756.26119-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Caught by ASan, if a secondary process tried to attach a device with an incorrect driver name, devargs was leaked. Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage") Cc: stable@dpdk.org Signed-off-by: David Marchand --- lib/eal/common/eal_common_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index c0ee4e442f..9d913e5478 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -180,8 +180,10 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev) return ret; err_devarg: - if (rte_devargs_remove(da) != 0) + if (rte_devargs_remove(da) != 0) { rte_devargs_reset(da); + free(da); + } return ret; } -- 2.23.0