Re: [PATCH] isdn divas: fix proc creation

Previous thread: [PATCH] edd: fix suspicious return of 1 from module_init by Alexey Dobriyan on Friday, May 30, 2008 - 7:29 pm. (1 message)

Next thread: netsc520 remapping RAM by Alexey Dobriyan on Friday, May 30, 2008 - 7:38 pm. (1 message)
To: <akpm@...>
Cc: <linux-kernel@...>
Date: Friday, May 30, 2008 - 7:34 pm

1. creating proc entry and not saving pointer to PDE and checking it
is not going to work.
2. if proc entry wasn't created, no reason to remove it on error path.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

drivers/isdn/hardware/eicon/divasmain.c | 1 -
drivers/isdn/hardware/eicon/divasproc.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)

--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)

if (!create_divas_proc()) {
#ifdef MODULE
- remove_divas_proc();
divas_unregister_chrdev();
divasfunc_exit();
#endif
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -125,8 +125,8 @@ static const struct file_operations divas_fops = {

int create_divas_proc(void)
{
- proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon,
- &divas_fops);
+ divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO,
+ proc_net_eicon, &divas_fops);
if (!divas_proc_entry)
return (0);

--

To: Alexey Dobriyan <adobriyan@...>
Cc: <akpm@...>, <linux-kernel@...>
Date: Thursday, June 5, 2008 - 6:25 am

I don't know where you found this. I have look even in older versions, but
the pointer divas_proc_entry is set by proc_create(). The patch to
divasproc.c is wrong, it exists from the beginning of the driver.

Agreed here. The reason for doing remove_divas_proc() anyway, was to
make sure all possible settings done in !create_divas_proc() are
reverted. But since nothing else is done here, it is okay to remove it.

--

To: Armin Schindler <armin@...>
Cc: <akpm@...>, <linux-kernel@...>
Date: Friday, June 6, 2008 - 2:17 am

--

To: Alexey Dobriyan <adobriyan@...>
Cc: <akpm@...>, <linux-kernel@...>
Date: Friday, June 6, 2008 - 2:44 am

Ah, okay. So someone removed the pointer between 2.6.25 and 2.6.26 then.
In that case your patch is correct of course.

--

Previous thread: [PATCH] edd: fix suspicious return of 1 from module_init by Alexey Dobriyan on Friday, May 30, 2008 - 7:29 pm. (1 message)

Next thread: netsc520 remapping RAM by Alexey Dobriyan on Friday, May 30, 2008 - 7:38 pm. (1 message)