From: Dan Carpenter Date: Tue, 7 Apr 2020 03:10:35 +0000 (-0700) Subject: lib/test_kmod.c: remove a NULL test X-Git-Tag: v5.15~4112^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f0259c27c850403c6a2076ef07180dd802da559;p=platform%2Fkernel%2Flinux-starfive.git lib/test_kmod.c: remove a NULL test The "info" pointer has already been dereferenced so checking here is too late. Fortunately, we never pass NULL pointers to the test_kmod_put_module() function so the test can simply be removed. Signed-off-by: Dan Carpenter Signed-off-by: Andrew Morton Acked-by: Luis Chamberlain Link: http://lkml.kernel.org/r/20200228092452.vwkhthsn77nrxdy6@kili.mountain Signed-off-by: Linus Torvalds --- diff --git a/lib/test_kmod.c b/lib/test_kmod.c index 9cf7762..e651c37 100644 --- a/lib/test_kmod.c +++ b/lib/test_kmod.c @@ -204,7 +204,7 @@ static void test_kmod_put_module(struct kmod_test_device_info *info) case TEST_KMOD_DRIVER: break; case TEST_KMOD_FS_TYPE: - if (info && info->fs_sync && info->fs_sync->owner) + if (info->fs_sync && info->fs_sync->owner) module_put(info->fs_sync->owner); break; default: