Re: [PATCH] staging: unisys: add visorhid driver

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

 



On Thu, Jun 25, 2015 at 09:58:51AM -0400, Benjamin Romer wrote:
> From: Erik Arfvidson <erik.arfvidson@xxxxxxxxxx>
> 
<snip>
> +static int
> +visorhid_init(void)
> +{
> +	int rc = 0;
> +
> +	spin_lock_init(&devnopool_lock);
> +	dev_no_pool = kzalloc(BITS_TO_LONGS(MAXDEVICES), GFP_KERNEL);
> +	if (!dev_no_pool) {
> +		rc = -ENOMEM;
> +		goto cleanups;
> +	}
> +	visorbus_register_visor_driver(&visorhid_driver);
> +cleanups:
> +	if (rc < 0)
> +		visorhid_cleanup_guts();
This will be true only if kzalloc fails. And if kzalloc fails then the
visorhid_driver is still not registered. But in the cleanups you are
calling visorhid_cleanup_guts() which will try to unregister the driver
and that should generate a warning by driver_unregister as we are trying
to unregister a driver which is not yet registerd.

regards
sudip
_______________________________________________
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