[PATCH 030/141] staging: unisys: unify devmajorminor attributes into visorbus_main.c
Dan Carpenter
dan.carpenter at oracle.com
Sat May 9 08:37:43 UTC 2015
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
More information about the devel
mailing list