Re: [tip: irq/urgent] irqchip/gic-v3-its: Fix potential race condition in its_vlpi_prop_update()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> [ tglx: Use guard() instead of goto ]
…
> +++ b/drivers/irqchip/irq-gic-v3-its.c
…
> @@ -1992,6 +1970,8 @@ static int its_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
>  	if (!is_v4(its_dev->its))
>  		return -EINVAL;
>
> +	guard(raw_spinlock_irq, &its_dev->event_map.vlpi_lock);
> +
>  	/* Unmap request? */
>  	if (!info)
>  		return its_vlpi_unmap(d);

I found a similar guard() call in the implementation of the function “task_state_match”.
https://elixir.bootlin.com/linux/v6.10-rc2/source/kernel/sched/core.c#L2264

A slightly different combination of parentheses is applied there.
How do you think about to apply the following code variant accordingly?

+	guard(raw_spinlock_irq)(&its_dev->event_map.vlpi_lock);


Regards,
Markus





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux