mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@redhat.com, rostedt@goodmis.org,
	Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v1] kernel/trace/trace: check the return value of tracing_update_buffers()
Date: Fri, 16 Sep 2022 19:03:53 -0700	[thread overview]
Message-ID: <20220917020353.3836285-1-floridsleeves@gmail.com> (raw)

Check the return value of tracing_update_buffers() in case it fails.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 kernel/trace/trace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index d3005279165d..0e367e326147 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -3305,7 +3305,8 @@ void trace_printk_init_buffers(void)
 	pr_warn("**********************************************************\n");
 
 	/* Expand the buffers to set size */
-	tracing_update_buffers();
+	if (tracing_update_buffers() < 0)
+		return;
 
 	buffers_allocated = 1;
 
-- 
2.25.1


             reply	other threads:[~2022-09-17  2:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  2:03 Li Zhong [this message]
2022-09-26 18:32 ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220917020353.3836285-1-floridsleeves@gmail.com \
    --to=floridsleeves@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®