]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firewire: ohci: move self_id_complete tracepoint after validating register
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sat, 23 Aug 2025 03:09:52 +0000 (12:09 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:03 +0000 (15:34 -0500)
[ Upstream commit 696968262aeee51e1c0529c3c060ddd180702e02 ]

The value of OHCI1394_SelfIDCount register includes an error-indicating
bit. It is safer to place the tracepoint probe after validating the
register value.

Link: https://lore.kernel.org/r/20250823030954.268412-2-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firewire/ohci.c

index 7ee55c2804dedf0977db4a375a51bbcff0dddbe3..90fcab1f65bcd8bd1cdec1f9a2788b3db1226d84 100644 (file)
@@ -2060,6 +2060,9 @@ static void bus_reset_work(struct work_struct *work)
                ohci_notice(ohci, "self ID receive error\n");
                return;
        }
+
+       trace_self_id_complete(ohci->card.index, reg, ohci->self_id, has_be_header_quirk(ohci));
+
        /*
         * The count in the SelfIDCount register is the number of
         * bytes in the self ID receive buffer.  Since we also receive
@@ -2228,15 +2231,8 @@ static irqreturn_t irq_handler(int irq, void *data)
        if (event & OHCI1394_busReset)
                reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
 
-       if (event & OHCI1394_selfIDComplete) {
-               if (trace_self_id_complete_enabled()) {
-                       u32 reg = reg_read(ohci, OHCI1394_SelfIDCount);
-
-                       trace_self_id_complete(ohci->card.index, reg, ohci->self_id,
-                                              has_be_header_quirk(ohci));
-               }
+       if (event & OHCI1394_selfIDComplete)
                queue_work(selfid_workqueue, &ohci->bus_reset_work);
-       }
 
        if (event & OHCI1394_RQPkt)
                tasklet_schedule(&ohci->ar_request_ctx.tasklet);