aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorUwe Kleine-König2023-10-13 15:24:42 +0200
committerChristian Brauner2023-10-19 11:03:16 +0200
commite311ba29a552194ece6c1579fe434bdad550bfac (patch)
tree244e9001a9bf8cd1ab21a0f53d601e84e04f6761 /fs
parent2bc5e5e8167f2114976f00755b9a0c7f17d6f105 (diff)
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/char_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index 950b6919fb87..6ba032442b39 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -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)