PVS V595: use before null-check

Change-Id: I1e74b376d77686c08778882b6f2c4c67a51b6eb3
Reviewed-on: https://review.haiku-os.org/c/1614
Reviewed-by: Stephan Aßmus <[email protected]>
This commit is contained in:
Adrien Destugues
2019-07-17 01:57:50 +00:00
committed by waddlesplash
parent 6cc8d65e9e
commit 0c5f4fb751
5 changed files with 36 additions and 31 deletions
@@ -423,12 +423,12 @@ intel_propose_display_mode(display_mode* target, const display_mode* low,
status_t status_t
intel_set_display_mode(display_mode* mode) intel_set_display_mode(display_mode* mode)
{ {
TRACE("%s(%" B_PRIu16 "x%" B_PRIu16 ")\n", __func__,
mode->virtual_width, mode->virtual_height);
if (mode == NULL) if (mode == NULL)
return B_BAD_VALUE; return B_BAD_VALUE;
TRACE("%s(%" B_PRIu16 "x%" B_PRIu16 ")\n", __func__,
mode->virtual_width, mode->virtual_height);
display_mode target = *mode; display_mode target = *mode;
// TODO: it may be acceptable to continue when using panel fitting or // TODO: it may be acceptable to continue when using panel fitting or
@@ -685,23 +685,25 @@ TeamDescriptionView::SetItem(TeamListItem* item)
fItem = item; fItem = item;
if (item == NULL) { if (item == NULL) {
int32 styleStart = 0; if (fInfoTextView != NULL) {
int32 styleEnd = 0; int32 styleStart = 0;
BString text; int32 styleEnd = 0;
BString text;
text.SetToFormat(fInfoString, fSeconds); text.SetToFormat(fInfoString, fSeconds);
fInfoTextView->SetText(text); fInfoTextView->SetText(text);
if (fRebootRunner != NULL && fSeconds < 4) { if (fRebootRunner != NULL && fSeconds < 4) {
styleStart = text.FindLast('\n'); styleStart = text.FindLast('\n');
styleEnd = text.Length(); styleEnd = text.Length();
} }
if (styleStart != styleEnd && fInfoTextView != NULL) { if (styleStart != styleEnd) {
BFont font; BFont font;
fInfoTextView->GetFont(&font); fInfoTextView->GetFont(&font);
font.SetFace(B_BOLD_FACE); font.SetFace(B_BOLD_FACE);
fInfoTextView->SetStylable(true); fInfoTextView->SetStylable(true);
fInfoTextView->SetFontAndColor(styleStart, styleEnd, &font); fInfoTextView->SetFontAndColor(styleStart, styleEnd, &font);
}
} }
} else { } else {
fTeamName->SetText(item->Path()->Path()); fTeamName->SetText(item->Path()->Path());
@@ -506,10 +506,13 @@ uninit_bus(void* bus_cookie)
remove_io_interrupt_handler(bus->irq, virtio_pci_config_interrupt, remove_io_interrupt_handler(bus->irq, virtio_pci_config_interrupt,
bus); bus);
} }
sPCIx86Module->disable_msi(bus->info.bus,
bus->info.device, bus->info.function); if (sPCIx86Module != NULL) {
sPCIx86Module->unconfigure_msi(bus->info.bus, sPCIx86Module->disable_msi(bus->info.bus,
bus->info.device, bus->info.function); bus->info.device, bus->info.function);
sPCIx86Module->unconfigure_msi(bus->info.bus,
bus->info.device, bus->info.function);
}
} else } else
remove_io_interrupt_handler(bus->irq, virtio_pci_interrupt, bus); remove_io_interrupt_handler(bus->irq, virtio_pci_interrupt, bus);
if (sPCIx86Module != NULL) { if (sPCIx86Module != NULL) {
@@ -1219,7 +1219,7 @@ hda_hw_uninit(hda_controller* controller)
// Disable interrupts, and remove interrupt handler // Disable interrupts, and remove interrupt handler
controller->Write32(HDAC_INTR_CONTROL, 0); controller->Write32(HDAC_INTR_CONTROL, 0);
if (controller->msi) { if (controller->msi && gPCIx86Module != NULL) {
// Disable MSI // Disable MSI
gPCIx86Module->disable_msi(controller->pci_info.bus, gPCIx86Module->disable_msi(controller->pci_info.bus,
controller->pci_info.device, controller->pci_info.function); controller->pci_info.device, controller->pci_info.function);
+8 -8
View File
@@ -135,15 +135,15 @@ dosfs_release_vnode(fs_volume *_vol, fs_vnode *_node, bool reenter)
TOUCH(reenter); TOUCH(reenter);
DPRINTF(0, ("dosfs_release_vnode (ino_t %" B_PRIdINO ")\n", node->vnid));
if ((vol->fs_flags & FS_FLAGS_OP_SYNC) && node->dirty) {
LOCK_VOL(vol);
_dosfs_sync(vol);
UNLOCK_VOL(vol);
}
if (node != NULL) { if (node != NULL) {
DPRINTF(0, ("dosfs_release_vnode (ino_t %" B_PRIdINO ")\n", node->vnid));
if ((vol->fs_flags & FS_FLAGS_OP_SYNC) && node->dirty) {
LOCK_VOL(vol);
_dosfs_sync(vol);
UNLOCK_VOL(vol);
}
#if TRACK_FILENAME #if TRACK_FILENAME
if (node->filename) free(node->filename); if (node->filename) free(node->filename);
#endif #endif