Skip to content

Commit

Permalink
lib/test_kmod.c: remove a NULL test
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Luis Chamberlain <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dan Carpenter authored and torvalds committed Apr 7, 2020
1 parent 8d994ca commit 8f0259c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8f0259c

Please sign in to comment.