All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Atharva Tiwari" <atharvatiwarilinuxdev@gmail.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] thunderbolt: Add device links for Apple T2 NHI
Date: Sun, 19 Jul 2026 18:12:00 +0000	[thread overview]
Message-ID: <20260719181200.C265A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260719180308.1398-3-atharvatiwarilinuxdev@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The boolean variable `ret` is returned uninitialized when `has_t2_chip` is true and no device links are successfully created.
--

--- Patch [2]: [PATCH 2/2] thunderbolt: Add device links for Apple T2 NHI ---
Note: The format of this report has been altered to provide a free-form summary
of the findings rather than inline diff quoting, due to recitation restrictions
on the original patch code.

commit 02f82ba0cab274de03252dcd3722c98f27a73abf
Author: Andre Eikmeyer <andre@negmaster.com>
thunderbolt: Add device links for Apple T2 NHI

This commit adds support for Thunderbolt NHI on T2 Macs by searching for root
ports in ACPI named TRP0, TRP1, etc. It creates device links back to the NHI
so that PCIe tunnels can be re-established after sleep.

[Severity: High]
Could this return an uninitialized value?

In tb_apple_add_links(), the boolean variable ret is declared without an
initial value. If the system has a T2 chip, the code enters a nested loop
searching for PCIe root ports to link. If no root ports match the required
ACPI prefix, or if device link creation fails for all found ports, the loops
complete and the function returns ret without ever having assigned it.

If the uninitialized stack value evaluates to true, might this cause the
caller to incorrectly assume device links were successfully established,
potentially skipping necessary fallback paths like tb_acpi_add_links?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260719180308.1398-1-atharvatiwarilinuxdev@gmail.com?part=2

      reply	other threads:[~2026-07-19 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-19 18:03 [PATCH 0/2] Add Apple T2 NHI device links Atharva Tiwari
2026-07-19 18:03 ` [PATCH 1/2] treewide: Add a flag to detect the Apple T2 chip Atharva Tiwari
2026-07-19 18:14   ` sashiko-bot
2026-07-19 18:03 ` [PATCH 2/2] thunderbolt: Add device links for Apple T2 NHI Atharva Tiwari
2026-07-19 18:12   ` sashiko-bot [this message]

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=20260719181200.C265A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atharvatiwarilinuxdev@gmail.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.