From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04A883A961A for ; Tue, 23 Jun 2026 05:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782192940; cv=none; b=WYvHZkWQJPhx0qj45ARfx0VK2MzVHm5kxvIOaQcCMT3s5Qn4/ACcn7witgbFnR3b69rp6BXBjTgNvF97XIUSlEF1iHfzO5JNukPgyfsGo1yWYNbKaiZmUMEFnpTcI7w+7MRdFPk1LpA0qfPpwmtD43V0jfBzrKUp6VBZlix+HjI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782192940; c=relaxed/simple; bh=BbUouOHmI4EMqhApuLX2WvLmovOe0WVOORDqWYarG1o=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=cqhcEZoPyLDM0gL7mbuBbAukA7buZHn0U6dQ4MaXkUqCzxBxmadr73TIAky1FrEe33jlF2RNC/y5M4MmycetJJuZjPTnF+Vp95uQ9SoGbnovvOwdEle39GdXstVLbNS86Preqm53gnWAz2ynXopYosmS+OwcYGJr+PGXPLq9xG4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=ezEVIDZc; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ezEVIDZc" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-139871a52c2so7446596c88.1 for ; Mon, 22 Jun 2026 22:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1782192938; x=1782797738; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=doIaMLEu5kLEU0NjfednT9dLYxmCETOQdr1ejlkBeVY=; b=ezEVIDZcFo/XP1V94MM0nH0W47X03fqHKF9UkXj6TqoS71cFUriaG8RaW6wC80Pz1d oZfKfYHJuFfMN5XrOLzBj2s0q53meKtIALoSA7iKz2Pdcn9trbsxZPYXVFEw8w4BQoEs h4zuH6cApuwfH7rlHxek1qe7CuaMYLLsTIRp4OdJDT84M7iXkoCc8ZiLzcbWdZp3I/J8 QqAm+0atA7aNLiuu5HRuoDk9kWtB1CfSKp3Jhc/oSlacxRUV6aEcbI3XOknebPVGsa4R DH1tPyGe66TmwmxVQXSLEIr6ivEx14JoBTryi13Mb3NbNbfFzvfXP2HGm2hL7WtZFZxr RlUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782192938; x=1782797738; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=doIaMLEu5kLEU0NjfednT9dLYxmCETOQdr1ejlkBeVY=; b=g+gHHCIHTqrRnLhLTMHmdPC2mHB8ulcYHjfW5283O44oWcV/IzA22AeTxhQHaQM80l NIYs9se4ElM4PBKoZygyAAMBlgDZiB0rTO1vr/dPUVKgr//qtHGNKLztiLqT9fQKtnK0 I0yq9Etf+rtaNhxxf/OyIYdhLiAHh/AqB62ONQDrtppjDy8ymCzLyIP3zOkoREcL9a0V lvZP7Y8RQ4JOmpxKhvxfzf4cE6lkaSGP5hKENJLs/uiw57D8raiEh2feJZNHf/xFL7++ 9+OvBtblHMG+gCtvVb1SG8LWEkF3Ii3IOe+9+5/4XxPH5K0TiCFDFqC3/dFtazYBJ7ee CDYg== X-Forwarded-Encrypted: i=1; AFNElJ8sLOGa+xmSRjqIMHzTRBReSl31BbBVqK+qov6pQFUgWQfzZYcv/KYON9zxDMA55eSsVQLp9F033gJYMDA=@vger.kernel.org X-Gm-Message-State: AOJu0YyFwxCFc4mrT/ck14aNxC6jTAxECESCA/ZuhUIN/QGJ4aSLl4Rh rb6OGd3hA/rl5N6XTOcQUWBcQC7xDXSzjwbLX3xgXF/gq5XMCKrbGFa5G4/k0is84Ye+868cM+b CMbyvbWHApg== X-Received: from dlep20-n1.prod.google.com ([2002:a05:701b:4594:10b0:135:5a9c:4291]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:6894:b0:137:e6a9:b998 with SMTP id a92af1059eb24-139a38812ccmr10352770c88.31.1782192937956; Mon, 22 Jun 2026 22:35:37 -0700 (PDT) Date: Mon, 22 Jun 2026 22:35:06 -0700 In-Reply-To: <20260623053515.2677888-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260623053515.2677888-1-irogers@google.com> X-Mailer: git-send-email 2.55.0.rc0.786.g65d90a0328-goog Message-ID: <20260623053515.2677888-5-irogers@google.com> Subject: [PATCH v1 04/13] perf python: Fix memory leak in pyrf_evlist__get_pollfd From: Ian Rogers To: acme@kernel.org, namhyung@kernel.org Cc: adrian.hunter@intel.com, alice.mei.rogers@gmail.com, dapeng1.mi@linux.intel.com, james.clark@linaro.org, leo.yan@linux.dev, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, mingo@redhat.com, peterz@infradead.org, tmricht@linux.ibm.com, Ian Rogers Content-Type: text/plain; charset="UTF-8" Fix a Python list object leak in pyrf_evlist__get_pollfd() by adding a missing Py_DECREF on the error exit path. Assisted-by: Antigravity:gemini-3.1-pro Fixes: 877108e42b1b ("perf tools: Initial python binding") Signed-off-by: Ian Rogers --- tools/perf/util/python.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 11e1f39c1bea..21e8b5a23a1c 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -2843,6 +2843,7 @@ static PyObject *pyrf_evlist__get_pollfd(struct pyrf_evlist *pevlist, return list; free_list: + Py_DECREF(list); return PyErr_NoMemory(); } -- 2.55.0.rc0.786.g65d90a0328-goog