When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. Cc: Andrew Morton Reviewed-by: Yang Yingliang <yangyingliang@...
struct dentry *mod_entry = debugfs_lookup(KBUILD_MODNAME, NULL);debugfs_remove(debugfs_lookup(dev_name(device->dev), mod_entry)); debugfs_lookup_and_remove(dev_name(device->dev), root_dir);/* free GPIOs */ free_gpio(device);
When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once. Cc: Andrew Morton Reviewed-by: Yang Yingliang <yangyingliang@...
dir=debugfs_lookup(attr->kp.symbol_name,fei_debugfs_dir); debugfs_remove_recursive(dir); debugfs_lookup_and_remove(attr->kp.symbol_name,fei_debugfs_dir); } staticintfei_kprobe_handler(structkprobe*kp,structpt_regs*regs) Expand Down