The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Colin King (gmail)" <colin.i.king@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: linux-next: kernel/trace/ring_buffer.c
Date: Mon, 21 Oct 2024 15:58:56 +0100	[thread overview]
Message-ID: <ecd7a510-addc-449e-a5a0-3ea144a76917@gmail.com> (raw)


Hi,

Static analysis on today's linux next found an issue in 
kernel/trace/ring_buffer.c in line 1538, after a 
raw_spin_unlock_irqrestore() call.  There is a return statement on line 
1538 so that all subsequent code is not being executed, which doesn't 
look correct. Not sure what the return is doing, perhaps is a 
consequence of a mis-merge of code.

Colin


commit id     line  source
1f1c2bc9d0753 1527) again:
1f1c2bc9d0753 1528)      if (++nr_loops > 3)
b4b55dfd96505 1529)              return;
7a8e76a3829f1 1530)
1f1c2bc9d0753 1531)      raw_spin_lock_irqsave(&cpu_buffer->reader_lock, 
flags);
1f1c2bc9d0753 1532)      head = rb_list_head(cpu_buffer->pages);
1f1c2bc9d0753 1533)      if (!rb_check_links(cpu_buffer, head))
1f1c2bc9d0753 1534)              goto out_locked;
1f1c2bc9d0753 1535)      buffer_cnt = cpu_buffer->cnt;
1f1c2bc9d0753 1536)      tmp = head;
1f1c2bc9d0753 1537) 
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
b4b55dfd96505 1538)              return;        /// <- issue HERE
77ae365eca895 1539)
1f1c2bc9d0753 1540)      while (true) {
1f1c2bc9d0753 1541) 
raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags);
8843e06f67b14 1542)
1f1c2bc9d0753 1543)              if (buffer_cnt != cpu_buffer->cnt) {
1f1c2bc9d0753 1544)                      /* The list was updated, try 
again. */
1f1c2bc9d0753 1545) 
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
1f1c2bc9d0753 1546)                      goto again;
1f1c2bc9d0753 1547)              }
1f1c2bc9d0753 1548)
1f1c2bc9d0753 1549)              tmp = rb_list_head(tmp->next);
1f1c2bc9d0753 1550)              if (tmp == head)
1f1c2bc9d0753 1551)                      /* The iteration circled back, 
all is done. */
1f1c2bc9d0753 1552)                      goto out_locked;
1f1c2bc9d0753 1553)
1f1c2bc9d0753 1554)              if (!rb_check_links(cpu_buffer, tmp))
1f1c2bc9d0753 1555)                      goto out_locked;
1f1c2bc9d0753 1556)
1f1c2bc9d0753 1557) 
raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags);
7a8e76a3829f1 1558)      }

                 reply	other threads:[~2024-10-21 14:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=ecd7a510-addc-449e-a5a0-3ea144a76917@gmail.com \
    --to=colin.i.king@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --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