user warning: Got error 28 from storage engine query: SELECT t.*,v.weight AS v_weight_unused FROM term_node r INNER JOIN term_data t ON r.tid = t.tid INNER JOIN vocabulary v ON t.vid = v.vid WHERE r.vid = 109 ORDER BY v.weight, t.weight, in /opt/drupal-6.33/modules/taxonomy/taxonomy.module on line 640.


Issue of the Implementation # L0026


drivers/rtc/rtc-proc.c: have no module_put after module get on error path

Detailed Description

In file drivers/rtc/rtc-proc.c function seq_open() can return -ENOMEM.

 86        if (!try_module_get(THIS_MODULE))
 87                return -ENODEV;
 89        return single_open(file, rtc_proc_show, rtc);
In this case before exiting (line 89) from rtc_proc_open the module_put(THIS_MODULE) must be called.

Possible solutions

 drivers/rtc/rtc-proc.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff -puN drivers/rtc/rtc-proc.c~drivers-rtc-add-module_put-on-error-path-in-rtc_proc_open drivers/rtc/rtc-proc.c
--- a/drivers/rtc/rtc-proc.c~drivers-rtc-add-module_put-on-error-path-in-rtc_proc_open
+++ a/drivers/rtc/rtc-proc.c
@@ -81,12 +81,16 @@ static int rtc_proc_show(struct seq_file

 static int rtc_proc_open(struct inode *inode, struct file *file)
+       int ret;
       struct rtc_device *rtc = PDE(inode)->data;

       if (!try_module_get(THIS_MODULE))
               return -ENODEV;

-       return single_open(file, rtc_proc_show, rtc);
+       ret = single_open(file, rtc_proc_show, rtc);
+       if (ret)
+               module_put(THIS_MODULE);
+       return ret;


linux-kernel 2.6.37



Fixed in kernel 2.6.38-rc5