aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-proc.c')
-rw-r--r--drivers/rtc/rtc-proc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index c086fc30a84c..242bbf86c74a 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -81,12 +81,16 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
81 81
82static int rtc_proc_open(struct inode *inode, struct file *file) 82static int rtc_proc_open(struct inode *inode, struct file *file)
83{ 83{
84 int ret;
84 struct rtc_device *rtc = PDE(inode)->data; 85 struct rtc_device *rtc = PDE(inode)->data;
85 86
86 if (!try_module_get(THIS_MODULE)) 87 if (!try_module_get(THIS_MODULE))
87 return -ENODEV; 88 return -ENODEV;
88 89
89 return single_open(file, rtc_proc_show, rtc); 90 ret = single_open(file, rtc_proc_show, rtc);
91 if (ret)
92 module_put(THIS_MODULE);
93 return ret;
90} 94}
91 95
92static int rtc_proc_release(struct inode *inode, struct file *file) 96static int rtc_proc_release(struct inode *inode, struct file *file)