#include #include #include #include "notifier-error-inject.h" static int priority; module_param(priority, int, 0); MODULE_PARM_DESC(priority, "specify netdevice notifier priority"); static struct notifier_err_inject netdev_notifier_err_inject = { .actions = { { NOTIFIER_ERR_INJECT_ACTION(NETDEV_REGISTER) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_CHANGEMTU) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_CHANGENAME) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_PRE_UP) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_PRE_TYPE_CHANGE) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_POST_INIT) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_PRECHANGEMTU) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_PRECHANGEUPPER) }, { NOTIFIER_ERR_INJECT_ACTION(NETDEV_CHANGEUPPER) }, {} } }; static struct dentry *dir; static int netdev_err_inject_init(void) { int err; dir = notifier_err_inject_init("netdev", notifier_err_inject_dir, &netdev_notifier_err_inject, priority); if (IS_ERR(dir)) return PTR_ERR(dir); err = register_netdevice_notifier(&netdev_notifier_err_inject.nb); if (err) debugfs_remove_recursive(dir); return err; } static void netdev_err_inject_exit(void) { unregister_netdevice_notifier(&netdev_notifier_err_inject.nb); debugfs_remove_recursive(dir); } module_init(netdev_err_inject_init); module_exit(netdev_err_inject_exit); MODULE_DESCRIPTION("Netdevice notifier error injection module"); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Nikolay Aleksandrov "); summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-05 23:06:06 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-05 23:06:06 -0800
commit6989606a7224a2d5a925df22a49e4f7a0bfed0d6 (patch)
tree2fb686a4dea9a7f4beec97fde510f2840c8e06f9 /include/drm/drm_plane.h
parented40875dd4b4c7b5c991db9e06c984180ab0b3ce (diff)
parentbe29d20f3f5db1f0b4e49a4f6eeedf840e2bf9b1 (diff)
Merge branch 'stable-4.10' of git://git.infradead.org/users/pcmoore/audit
Pull audit fixes from Paul Moore: "Two small fixes relating to audit's use of fsnotify. The first patch plugs a leak and the second fixes some lock shenanigans. The patches are small and I banged on this for an afternoon with our testsuite and didn't see anything odd" * 'stable-4.10' of git://git.infradead.org/users/pcmoore/audit: audit: Fix sleep in atomic fsnotify: Remove fsnotify_duplicate_mark()
Diffstat (limited to 'include/drm/drm_plane.h')