Re: [PATCH 030/141] staging: unisys: unify devmajorminor attributes into visorbus_main.c

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

 



On Tue, May 05, 2015 at 06:36:07PM -0400, Benjamin Romer wrote:
> -void
> -devmajorminor_remove_file(struct visor_device *dev, int slot)
> -{
> -	int maxdevnodes = ARRAY_SIZE(dev->devnodes) / sizeof(dev->devnodes[0]);
> -	struct devmajorminor_attribute *myattr = NULL;
> -
> -	if (slot < 0 || slot >= maxdevnodes)
> -		return;
> -	myattr = (struct devmajorminor_attribute *)(dev->devnodes[slot].attr);
> -	if (myattr)
> -		return;

You didn't introduce it, but this condition seems reversed.

> -	sysfs_remove_file(&dev->kobjdevmajorminor, &myattr->attr);
> -	kobject_uevent(&dev->device.kobj, KOBJ_OFFLINE);
> -	dev->devnodes[slot].attr = NULL;
> -	kfree(myattr);
> -}


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