From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70FCC2571D2; Thu, 17 Apr 2025 18:23:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744914233; cv=none; b=Gq1OHHAPpuvuUXPlfFDR+2FqcuVNcNsrG+a/5oU5kso5MVjBrhqTmE6wkGaG+4jYobGC40Z7xYTYur4EdAaBmCCVb4wxZR8vMR9ypMTbhasIdiqc/msFvioYV97idea5dB36RK1KASEdlaowAPLlhDt5uHzk5wQT98qL9RAy4Hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744914233; c=relaxed/simple; bh=+BdZ2DZPeZfPvFgAy9XTuX2eExsh08VA9Lj8teOq/1s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EnzvidIdnfHyDhDyrehM+MfEaIw66tvhZ9Kmfh02o5i2GzkJXi2cVXuko9XwinZ0Ror+hBP5BOasFYpcR8MxZ3MFnrcVw7cyMQ3CcqKdIicQtEJO72HEFixRwMLYDxKKxjM7CnnJST4vbX59hir7lq7FyyMnxcTgh+znprlz5jk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0r1jS0vt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="0r1jS0vt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8FB2C4CEE4; Thu, 17 Apr 2025 18:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744914233; bh=+BdZ2DZPeZfPvFgAy9XTuX2eExsh08VA9Lj8teOq/1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0r1jS0vtk0KPeob5BkC6e7JlGyAiRNA28ZrGg3E0nBdp66YgEFBvfUMaT5JfIqy2b rCZH8I53UpBfvauwyDv+2OAMwWQaCvs/dYJKMd31UuP3/2s3R8KXdGfSg3S+OuhE00 STGjTxoE1aC8nJlqSrb8OV14/07TBHuiuMOf0aRo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gabriele Paoloni , "Steven Rostedt (Google)" , Sasha Levin Subject: [PATCH 6.13 119/414] tracing: fix return value in __ftrace_event_enable_disable for TRACE_REG_UNREGISTER Date: Thu, 17 Apr 2025 19:47:57 +0200 Message-ID: <20250417175116.222865899@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175111.386381660@linuxfoundation.org> References: <20250417175111.386381660@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Gabriele Paoloni [ Upstream commit 0c588ac0ca6c22b774d9ad4a6594681fdfa57d9d ] When __ftrace_event_enable_disable invokes the class callback to unregister the event, the return value is not reported up to the caller, hence leading to event unregister failures being silently ignored. This patch assigns the ret variable to the invocation of the event unregister callback, so that its return value is stored and reported to the caller, and it raises a warning in case of error. Link: https://lore.kernel.org/20250321170821.101403-1-gpaoloni@redhat.com Signed-off-by: Gabriele Paoloni Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- kernel/trace/trace_events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 44d8549522501..a1cf3dae9a62d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -797,7 +797,9 @@ static int __ftrace_event_enable_disable(struct trace_event_file *file, clear_bit(EVENT_FILE_FL_RECORDED_TGID_BIT, &file->flags); } - call->class->reg(call, TRACE_REG_UNREGISTER, file); + ret = call->class->reg(call, TRACE_REG_UNREGISTER, file); + + WARN_ON_ONCE(ret); } /* If in SOFT_MODE, just set the SOFT_DISABLE_BIT, else clear it */ if (file->flags & EVENT_FILE_FL_SOFT_MODE) -- 2.39.5