RE: [PATCH v2 30/31] staging: comedi: ni_pcidio: request_irq() before seting up subdevices

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

 



On Friday, December 06, 2013 3:34 AM, Ian Abbott wrote:
> On 2013-12-05 20:43, H Hartley Sweeten wrote:

[snip]
>> +	irq = mite_irq(devpriv->mite);
>> +	if (irq) {
>> +		ret = request_irq(irq, nidio_interrupt, IRQF_SHARED,
>> +				  dev->board_name, dev);
>> +		if (ret == 0)
>> +			dev->irq = irq;
>> +	}
>> +
>>   	ret = comedi_alloc_subdevices(dev, 1);
>
> Unfortunately, the interrupt handler `nidio_interrupt()` still 
> dereferences the subdevice pointer before it tests `dev->attached`:
>
>	struct comedi_subdevice *s = dev->read_subdev;
>	struct comedi_async *async = s->async;	
>	/* ... */
>	if (!dev->attached) {
>		return IRQ_NONE;
>	}
>
> so this can still fail if `dev->read_subdev` hasn't been set yet.

I just posted a v3 of this patch to fix the possible dereference of 's'.

Thanks,
Hartley

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux