* Fix a few spots where we were checking for NULL unneededly

* Fix a few spots where we *should* of been checking for NULL
  to prevent referencing a null pointer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42505 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander von Gluck IV 2011-07-27 02:26:49 +00:00
parent 13e2521356
commit a956672a33

View File

@ -168,6 +168,7 @@ init_common(int device, bool isClone)
static void static void
uninit_common(void) uninit_common(void)
{ {
if (gInfo != NULL) {
delete_area(gInfo->regs_area); delete_area(gInfo->regs_area);
delete_area(gInfo->shared_info_area); delete_area(gInfo->shared_info_area);
@ -178,14 +179,15 @@ uninit_common(void)
close(gInfo->device); close(gInfo->device);
free(gInfo); free(gInfo);
}
for (uint32 id = 0; id < MAX_DISPLAY; id++) { for (uint32 id = 0; id < MAX_DISPLAY; id++) {
if (gDisplay[id]->regs != NULL) if (gDisplay[id] != NULL) {
free(gDisplay[id]->regs); free(gDisplay[id]->regs);
if (gDisplay[id] != NULL)
free(gDisplay[id]); free(gDisplay[id]);
} }
} }
}
// #pragma mark - public accelerant functions // #pragma mark - public accelerant functions