You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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 <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
This commit is contained in:
committed by
Antonio Quartulli
parent
8e7c15d6b5
commit
bd5b80d51a
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user