Skip to contentSkip to conversation

linux-2.6.18/gntdev: remove bogus and broken try_module_get()

PATCH New Jan Beulich 1 participant 1 message Jan 18, 2012 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

drivers/xen/gntdev/gntdev.c +0 -3
@@ -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;
 }