[PATCH 2/4] firewire: cdev: wake up client from queue_event() only when any event is available

From: Takashi Sakamoto

Date: Sat Sep 26 2026 - 23:44:22 EST


The in_shutdown member of client structure is set only when releasing
file descriptor, thus no need to wake up the client itself.

Signed-off-by: Takashi Sakamoto <o-takashi@xxxxxxxxxxxxx>
---
drivers/firewire/core-cdev.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 5020895c42a0..9a539de9b0a1 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -338,13 +338,14 @@ static void queue_event(struct client *client, struct event *event,
event->v[1].size = size1;

scoped_guard(spinlock_irqsave, &client->lock) {
- if (client->in_shutdown)
+ if (client->in_shutdown) {
kfree(event);
- else
+ } else {
list_add_tail(&event->link, &client->event_list);
- }

- wake_up_interruptible(&client->wait);
+ wake_up_interruptible(&client->wait);
+ }
+ }
}

static int dequeue_event(struct client *client,
--
2.53.0