chardev: Simplify usage of try_module_get()
try_module_get(NULL) is true, so there is no need to check owner being NULL. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231013132441.1406200-2-u.kleine-koenig@pengutronix.de Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
2bc5e5e816
commit
e311ba29a5
@ -350,7 +350,7 @@ static struct kobject *cdev_get(struct cdev *p)
|
||||
struct module *owner = p->owner;
|
||||
struct kobject *kobj;
|
||||
|
||||
if (owner && !try_module_get(owner))
|
||||
if (!try_module_get(owner))
|
||||
return NULL;
|
||||
kobj = kobject_get_unless_zero(&p->kobj);
|
||||
if (!kobj)
|
||||
|
Loading…
Reference in New Issue
Block a user