* [merged] drivers-rtc-add-module_put-on-error-path-in-rtc_proc_open.patch removed from -mm tree
@ 2011-02-14 20:19 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2011-02-14 20:19 UTC (permalink / raw)
To: cromlehg, a.zummo, strakh, mm-commits
The patch titled
drivers/rtc/rtc-proc.c: add module_put on error path in rtc_proc_open()
has been removed from the -mm tree. Its filename was
drivers-rtc-add-module_put-on-error-path-in-rtc_proc_open.patch
This patch was dropped because it was merged into mainline or a subsystem tree
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: drivers/rtc/rtc-proc.c: add module_put on error path in rtc_proc_open()
From: Alexander Strakh <cromlehg@gmail.com>
In file drivers/rtc/rtc-proc.c seq_open() can return -ENOMEM.
86 if (!try_module_get(THIS_MODULE))
87 return -ENODEV;
88
89 return single_open(file, rtc_proc_show, rtc);
In this case before exiting (li\x10ne 89) from rtc_proc_open
the module_put(THIS_MODULE) must be called.
Found by Linux Device Drivers Verification Project
Signed-off-by: Alexander Strakh <strakh@ispras.ru>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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;
}
static int rtc_proc_release(struct inode *inode, struct file *file)
_
Patches currently in -mm which might be from cromlehg@gmail.com are
origin.patch
linux-next.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-14 20:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 20:19 [merged] drivers-rtc-add-module_put-on-error-path-in-rtc_proc_open.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.