param: add a free hook to kernel_param_ops.
This allows us to generalize the KPARAM_KMALLOCED flag, by calling a function on every parameter when a module is unloaded. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Takashi Iwai <tiwai@suse.de> Tested-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
This commit is contained in:
@ -36,6 +36,8 @@ struct kernel_param_ops {
|
||||
int (*set)(const char *val, const struct kernel_param *kp);
|
||||
/* Returns length written or -errno. Buffer is 4k (ie. be short!) */
|
||||
int (*get)(char *buffer, const struct kernel_param *kp);
|
||||
/* Optional function to free kp->arg when module unloaded. */
|
||||
void (*free)(void *arg);
|
||||
};
|
||||
|
||||
/* Flag bits for kernel_param.flags */
|
||||
|
Reference in New Issue
Block a user