]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: remove redundant check for NULL [cppcheck]
authorBoris Egorov <egorov@linux.com>
Tue, 19 Jan 2016 06:18:21 +0000 (12:18 +0600)
committerBoris Egorov <egorov@linux.com>
Tue, 19 Jan 2016 06:59:12 +0000 (12:59 +0600)
We set SA_SIGINFO flag, so we should not get NULL.

[tests/helpers/test_sigreceive.c:45] -> [tests/helpers/test_sigreceive.c:47]: (warning) Either the condition 'if(info)' is redundant or there is possible null pointer dereference: info.

tests/helpers/test_sigreceive.c

index f1b954688b264c2e4b45e0d6c4b27b2f40eb4fbf..12b563a0ef8a4c51070691cdd40fdaa5ace5dc2b 100644 (file)
@@ -44,9 +44,8 @@ void exiter(int signo __attribute__((__unused__)),
 {
        int ret = info->si_signo;
 
-       if (info)
-               if (info->si_code == SI_QUEUE && info->si_value.sival_int != 0)
-                       ret = info->si_value.sival_int;
+       if (info->si_code == SI_QUEUE && info->si_value.sival_int != 0)
+               ret = info->si_value.sival_int;
        _exit(ret);
 }