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

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

 



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.

> +		return -EINVAL;
> +	}

regards,
dan carpenter
_______________________________________________
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