Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v1] ufs: core: Fix possible NULL pointer dereference in ufshcd_add_command_trace()
Date: Wed, 25 Feb 2026 05:53:52 +0000	[thread overview]
Message-ID: <066c65061be16076e60d5fd4a57a773c391a189f.camel@mediatek.com> (raw)
In-Reply-To: <72757f9f-20de-4fb8-b5eb-507dbcdbe22a@acm.org>

On Tue, 2026-02-24 at 08:48 -0800, Bart Van Assche wrote:
> Hi Peter,
> 
> That's not what I proposed. When ignoring the NULL test, this is what
> the current ufshcd_add_command_trace() implementation does:
> 
>         hwq_id = hba->uhq[READ_ONCE(req->mq_hctx)->queue_num].id;
> 
> That's more complicated than necessary. This should be sufficient
> (again ignoring the NULL test):
> 
>         hwq_id = READ_ONCE(req->mq_hctx)->queue_num;
> 
> Anyway, since the proposed change probably only results in a small
> performance improvement, let's proceed with the current patch.
> 
> Bart.

Hi Bart,

OK, I understand your point. However, there really shouldn’t
be a significant performance difference.
As for the patch with the fixes tag, I don’t think it’s 
necessarily an bug in that patch. It seems more like a corner
case that only occurs after errors happen consecutively.
Also, since Martin has already applied it, I won’t add the fixes
tag for now.

Thanks for the review.
Peter

  reply	other threads:[~2026-02-25  5:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23  6:56 [PATCH v1] ufs: core: Fix possible NULL pointer dereference in ufshcd_add_command_trace() peter.wang
2026-02-23 17:13 ` Bart Van Assche
2026-02-24  5:29   ` Peter Wang (王信友)
2026-02-24 16:48     ` Bart Van Assche
2026-02-25  5:53       ` Peter Wang (王信友) [this message]
2026-02-24 16:50 ` Bart Van Assche
2026-02-25  2:08 ` Martin K. Petersen
2026-02-25 19:45   ` Bart Van Assche
2026-02-28 22:37     ` Martin K. Petersen

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=066c65061be16076e60d5fd4a57a773c391a189f.camel@mediatek.com \
    --to=peter.wang@mediatek.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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