[patch] Registration Check for Compulsory Hooks
Kingsley Cheung <[email protected]>
| Newsgroups | gmane.linux.process-aggregates |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was reading through the linux-2.6.9-pagg.patch when I noticed that "init()", "exec()" are considered optional but "attach()" and "detach()" are compulsory. If that is true, then would perhaps there should be checks during registration to ensure "attach()" and "detach()" are defined? An untested patch against Linux 2.6.5 (that section of code hasn't changed in 2.6.9) is attached. Thanks, -- Kingsley
pagg.patch
(text/plain, 551 B)
Index: linux/kernel/pagg.c =================================================================== --- linux/kernel/pagg.c 22 Aug 2004 01:19:59 -0000 +++ linux/kernel/pagg.c 8 Nov 2004 03:30:39 -0000 @@ -236,6 +236,8 @@ return -EINVAL; /* error */ if (pagg_hook_new->name == NULL || strlen(pagg_hook_new->name) > PAGG_NAMELN) return -EINVAL; /* error */ + if (!pagg_hook_new->attach || !pagg_hook_new->detach) + return -EINVAL; /* error */ /* Try to insert new hook entry into the pagg hook list */ down_write(&pagg_hook_list_sem);