From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A130BA0096 for ; Mon, 6 May 2019 15:14:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 72D2937A2; Mon, 6 May 2019 15:14:53 +0200 (CEST) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id 92E4A374 for ; Mon, 6 May 2019 15:14:49 +0200 (CEST) Received: by mail-vs1-f65.google.com with SMTP id g127so8087530vsd.6 for ; Mon, 06 May 2019 06:14:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aEM6joCuZnULL8FV2w3oRpcSYtE+hjhnlHmSjhstr20=; b=ICtEWfeFY3aAwtJ5Qif/DfSLEyr7ZG7EzyT6SlEveiKjnIiP5IS96qN1O3CSsvcuE/ vVfhyCihfCA9UIfWhZfBGYZzwc0N8YVU/Khe2AZQGmG7SNOJ2UnKBoZxXtEI2n3vYMxX /MoVCiI+fZPTjb6A+H3dFa/xLqNMU11yOfJd64uQ8lYn6cBpRz9cpbQY5KrYuPE7UEw5 JBYUqdc5N5XEKgshqn2scKQEmPWNqBhWQfW9ZzCpjMr8t2Z9ijDjtrJwCimVQOmU7SYW SN9zGnGCzeiuWeIiZ8RZhk10Y6nDJerQzppySy4f0CiAxGBNo6/XqvKsZ1qTxCY/CQjd ozpg== X-Gm-Message-State: APjAAAVgD78uEigpb2r0erjZ+0W+1nOBsz5XC4B+fsZgOFHPSeOWpkZS hZphxTju6KSsS0b0z+h7XPF9IlFfq76HRlACIFxAbA== X-Google-Smtp-Source: APXvYqz3qhFsVF5WSVZj65oakLY2ZUNoV4X0gYySR+4SVLxIg9oF6xO+YyuuHH3IgmBH7sJb4tCNwj33ftm5RoTBMGo= X-Received: by 2002:a67:a446:: with SMTP id p6mr13240037vsh.198.1557148488885; Mon, 06 May 2019 06:14:48 -0700 (PDT) MIME-Version: 1.0 References: <20190506131120.25140-1-aconole@redhat.com> In-Reply-To: <20190506131120.25140-1-aconole@redhat.com> From: David Marchand Date: Mon, 6 May 2019 15:14:37 +0200 Message-ID: To: Aaron Conole Cc: dev , Herakliusz Lipiec , dpdk stable , Anatoly Burakov Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH] ipc: unlock on failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, May 6, 2019 at 3:11 PM Aaron Conole wrote: > Reported by Coverity. > > Fixes: a2a06860b8c4 ("ipc: fix memory leak on request failure") > Cc: Herakliusz Lipiec > Cc: stable@dpdk.org > Cc: Anatoly Burakov > Signed-off-by: Aaron Conole > --- > lib/librte_eal/common/eal_common_proc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_eal/common/eal_common_proc.c > b/lib/librte_eal/common/eal_common_proc.c > index d23728604..3498e6b07 100644 > --- a/lib/librte_eal/common/eal_common_proc.c > +++ b/lib/librte_eal/common/eal_common_proc.c > @@ -1005,8 +1005,10 @@ rte_mp_request_sync(struct rte_mp_msg *req, struct > rte_mp_reply *reply, > /* unlocks the mutex while waiting for response, > * locks on receive > */ > - if (mp_request_sync(path, req, reply, &end)) > + if (mp_request_sync(path, req, reply, &end)) { > + pthread_mutex_unlock(&pending_requests.lock); > goto err; > + } > } > pthread_mutex_unlock(&pending_requests.lock); > /* unlock the directory */ > -- > 2.19.1 > Unfortunately, I think this is more complex than this. We will leave a flock() pending and leak some resources from opendir(). -- David Marchand