Re: [PATCH 1/2] qla2xxx: Fix a recently introduced memory leak

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

 



On Sun, 2017-01-29 at 10:07 +0100, hch@xxxxxx wrote:
> Hi Bart,
> 
> thanks for the analysis.  I think the main issue here is that we shouldn't
> try to assign affinity masks if there are not affinity vectors left to
> assign.
> 
> Does the patch below fix the issue for you?
> 
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 50c5003..96c0713 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -1206,6 +1206,11 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
>  	if (flags & PCI_IRQ_AFFINITY) {
>  		if (!affd)
>  			affd = &msi_default_affd;
> +
> +		if (affd->pre_vectors + affd->post_vectors > min_vecs)
> +			return -EINVAL;
> +		if (affd->pre_vectors + affd->post_vectors == min_vecs)
> +			flags &=~ PCI_IRQ_AFFINITY;
>  	} else {
>  		if (WARN_ON(affd))
>  			affd = NULL;

Hello Christoph,

Thanks for the quick reply. Sorry but the above patch didn't help - the
PCI_IRQ_AFFINITY isn't tested after the above code clears it. But after I
changed "flags &=~ PCI_IRQ_AFFINITY" into "affd = NULL" the memory
corruption complaint was gone and I/O through the qla2xxx adapter
was still working fine. If you want you can add the following to the above
patch with the aforementioned change:

Tested-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>

Bart.��.n��������+%������w��{.n�����{������ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux