https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fda24da87224b6700669c…
commit fda24da87224b6700669cb49c9c9b49511d6cf0e
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Jan 20 13:42:39 2018 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Jan 20 15:59:35 2018 +0100
[NTOS] Remove unnecessary NULL checks and add a missing one. CIDs 1411958, 716670,
1322186
---
ntoskrnl/cc/fs.c | 1 -
ntoskrnl/dbgk/dbgkobj.c | 2 +-
ntoskrnl/ex/init.c | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/ntoskrnl/cc/fs.c b/ntoskrnl/cc/fs.c
index d62e18dee0..4958478f3f 100644
--- a/ntoskrnl/cc/fs.c
+++ b/ntoskrnl/cc/fs.c
@@ -337,7 +337,6 @@ CcUninitializeCacheMap (
FileObject, TruncateSize, UninitializeCompleteEvent);
if (TruncateSize != NULL &&
- FileObject->SectionObjectPointer != NULL &&
FileObject->SectionObjectPointer->SharedCacheMap != NULL)
{
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
diff --git a/ntoskrnl/dbgk/dbgkobj.c b/ntoskrnl/dbgk/dbgkobj.c
index d0f8c85c74..3f03e9b903 100644
--- a/ntoskrnl/dbgk/dbgkobj.c
+++ b/ntoskrnl/dbgk/dbgkobj.c
@@ -775,7 +775,7 @@ DbgkpPostFakeThreadMessages(IN PEPROCESS Process,
{
/* Dereference and fail */
if (pFirstThread) ObDereferenceObject(pFirstThread);
- if (pLastThread) ObDereferenceObject(pLastThread);
+ ObDereferenceObject(pLastThread);
return Status;
}
diff --git a/ntoskrnl/ex/init.c b/ntoskrnl/ex/init.c
index e4ffdd63bd..e2413349ca 100644
--- a/ntoskrnl/ex/init.c
+++ b/ntoskrnl/ex/init.c
@@ -1501,7 +1501,7 @@ Phase1InitializationDiscard(IN PVOID Context)
if (!PoInitSystem(0)) KeBugCheck(INTERNAL_POWER_ERROR);
/* Check for Y2K hack */
- Y2KHackRequired = strstr(CommandLine, "YEAR");
+ Y2KHackRequired = CommandLine ? strstr(CommandLine, "YEAR") : NULL;
if (Y2KHackRequired) Y2KHackRequired = strstr(Y2KHackRequired, "=");
if (Y2KHackRequired) YearHack = atol(Y2KHackRequired + 1);