From bd5b80d51a6c4a68f7d4b9b92c495329f47e53d4 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 20 Aug 2012 23:37:26 +0200 Subject: batman-adv: Check return value of try_module_get New operations should not be started when they need an increased module reference counter and try_module_get failed. This patch addresses Coverity #712284: Unchecked return value Signed-off-by: Sven Eckelmann Signed-off-by: Antonio Quartulli --- net/batman-adv/debugfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net/batman-adv/debugfs.c') diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c index 391d4fb2026f..bd032bc4e262 100644 --- a/net/batman-adv/debugfs.c +++ b/net/batman-adv/debugfs.c @@ -99,15 +99,17 @@ int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) static int batadv_log_open(struct inode *inode, struct file *file) { + if (!try_module_get(THIS_MODULE)) + return -EBUSY; + nonseekable_open(inode, file); file->private_data = inode->i_private; - batadv_inc_module_count(); return 0; } static int batadv_log_release(struct inode *inode, struct file *file) { - batadv_dec_module_count(); + module_put(THIS_MODULE); return 0; } -- cgit v1.2.3