lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 10 Mar 2011 00:33:05 -0500
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	Ian Campbell <ian.campbell@...rix.com>
Cc:	xen-devel@...ts.xensource.com, linux-kernel@...r.kernel.org,
	Jeremy Fitzhardinge <jeremy@...p.org>,
	Stefano Stabellini <Stefano.Stabellini@...citrix.com>
Subject: Re: [PATCH 12/14] xen: events: remove use of nr_irqs as upper
 bound on number of pirqs

>  int xen_irq_from_pirq(unsigned pirq)
>  {
> -	return pirq_to_irq[pirq];
> +	int irq;
> +
> +	struct irq_info *info;
> +
> +	spin_lock(&irq_mapping_update_lock);
> +
> +	list_for_each_entry(info, &xen_irq_list_head, list) {
> +		if (info == NULL || info->type != IRQT_PIRQ)
> +			continue;
> +		irq = info->irq;
> +		if (info->u.pirq.pirq == pirq)
> +			goto out;
> +	}
> +	irq = -1;
> +out:
> +	spin_lock(&irq_mapping_update_lock);
> +
> +	return -1;

Shouldn't this be:

  return irq

?

How come you are using the spin_lock here, but not
in other places when iterating over the xen_irq_list_head?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists