mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue