Re: [PATCH 01/37] staging: comedi: check comedi_auto_config() params

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

 



On 2013/04/04 08:24 PM, Dan Carpenter wrote:
> On Thu, Apr 04, 2013 at 02:58:42PM +0100, Ian Abbott wrote:
>> diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
>> index 4724f27..4460814 100644
>> --- a/drivers/staging/comedi/drivers.c
>> +++ b/drivers/staging/comedi/drivers.c
>> @@ -410,6 +410,16 @@ int comedi_auto_config(struct device *hardware_device,
>>  	struct comedi_device *comedi_dev;
>>  	int ret;
>>  
>> +	if (!hardware_device) {
>> +		pr_warn("BUG! comedi_auto_config called with NULL hardware_device\n");
> 
> 
> WARN() would give you a nice stack trace for easy debugging.

I could do.  It should be a fairly obvious bug if it occurs though.  It
could maybe output the driver name as long as the driver parameter is
not NULL (assuming it really is pointing to a valid struct comedi_driver!).

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx>             )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587              )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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