Jan Beulich
2012-Jan-18 16:17 UTC
[PATCH] linux-2.6.18/gntdev: remove bogus and broken try_module_get()
Its return value wasn''t checked, it wasn''t undone in the error path, and it was redundnant (the caller being responsible for doing this). Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/drivers/xen/gntdev/gntdev.c +++ b/drivers/xen/gntdev/gntdev.c @@ -427,8 +427,6 @@ static int gntdev_open(struct inode *ino { gntdev_file_private_data_t *private_data; - try_module_get(THIS_MODULE); - /* Allocate space for the per-instance private data. */ private_data = kmalloc(sizeof(*private_data), GFP_KERNEL); if (!private_data) @@ -467,7 +465,6 @@ static int gntdev_release(struct inode * kfree(private_data->free_list); kfree(private_data); } - module_put(THIS_MODULE); return 0; }