PVS V595: use before null-check

Change-Id: I1e74b376d77686c08778882b6f2c4c67a51b6eb3
Reviewed-on: https://review.haiku-os.org/c/1614
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This commit is contained in:
Adrien Destugues 2019-07-16 21:31:06 +02:00 committed by waddlesplash
parent 6cc8d65e9e
commit 0c5f4fb751
5 changed files with 36 additions and 31 deletions

View File

@ -423,12 +423,12 @@ intel_propose_display_mode(display_mode* target, const display_mode* low,
status_t
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)
return B_BAD_VALUE;
TRACE("%s(%" B_PRIu16 "x%" B_PRIu16 ")\n", __func__,
mode->virtual_width, mode->virtual_height);
display_mode target = *mode;
// TODO: it may be acceptable to continue when using panel fitting or

View File

@ -685,23 +685,25 @@ TeamDescriptionView::SetItem(TeamListItem* item)
fItem = item;
if (item == NULL) {
int32 styleStart = 0;
int32 styleEnd = 0;
BString text;
if (fInfoTextView != NULL) {
int32 styleStart = 0;
int32 styleEnd = 0;
BString text;
text.SetToFormat(fInfoString, fSeconds);
fInfoTextView->SetText(text);
if (fRebootRunner != NULL && fSeconds < 4) {
styleStart = text.FindLast('\n');
styleEnd = text.Length();
}
text.SetToFormat(fInfoString, fSeconds);
fInfoTextView->SetText(text);
if (fRebootRunner != NULL && fSeconds < 4) {
styleStart = text.FindLast('\n');
styleEnd = text.Length();
}
if (styleStart != styleEnd && fInfoTextView != NULL) {
BFont font;
fInfoTextView->GetFont(&font);
font.SetFace(B_BOLD_FACE);
fInfoTextView->SetStylable(true);
fInfoTextView->SetFontAndColor(styleStart, styleEnd, &font);
if (styleStart != styleEnd) {
BFont font;
fInfoTextView->GetFont(&font);
font.SetFace(B_BOLD_FACE);
fInfoTextView->SetStylable(true);
fInfoTextView->SetFontAndColor(styleStart, styleEnd, &font);
}
}
} else {
fTeamName->SetText(item->Path()->Path());

View File

@ -506,10 +506,13 @@ uninit_bus(void* bus_cookie)
remove_io_interrupt_handler(bus->irq, virtio_pci_config_interrupt,
bus);
}
sPCIx86Module->disable_msi(bus->info.bus,
bus->info.device, bus->info.function);
sPCIx86Module->unconfigure_msi(bus->info.bus,
bus->info.device, bus->info.function);
if (sPCIx86Module != NULL) {
sPCIx86Module->disable_msi(bus->info.bus,
bus->info.device, bus->info.function);
sPCIx86Module->unconfigure_msi(bus->info.bus,
bus->info.device, bus->info.function);
}
} else
remove_io_interrupt_handler(bus->irq, virtio_pci_interrupt, bus);
if (sPCIx86Module != NULL) {

View File

@ -1219,7 +1219,7 @@ hda_hw_uninit(hda_controller* controller)
// Disable interrupts, and remove interrupt handler
controller->Write32(HDAC_INTR_CONTROL, 0);
if (controller->msi) {
if (controller->msi && gPCIx86Module != NULL) {
// Disable MSI
gPCIx86Module->disable_msi(controller->pci_info.bus,
controller->pci_info.device, controller->pci_info.function);

View File

@ -135,15 +135,15 @@ dosfs_release_vnode(fs_volume *_vol, fs_vnode *_node, bool 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) {
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 (node->filename) free(node->filename);
#endif