Project

General

Profile

Bug #12325

ahci: variable may be used uninitialized

Added by Toomas Soome about 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with gcc 9:

    ../../common/io/sata/adapters/ahci/ahci.c: In function 'ahci_tran_probe_port':
    ../../common/io/sata/adapters/ahci/ahci.c:1592:18: error: 'port_state' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1592 |   if (port_state & SATA_STATE_READY)
    ../../common/io/sata/adapters/ahci/ahci.c: In function 'ahci_claim_free_slot':
    ../../common/io/sata/adapters/ahci/ahci.c:2102:9: error: 'free_slots' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2102 |  slot = ddi_ffs(free_slots) - 1;
          |         ^~~~~~~~~~~~~~~~~~~
    ../../common/io/sata/adapters/ahci/ahci.c: In function 'ahci_watchdog_handler':
    ../../common/io/sata/adapters/ahci/ahci.c:9931:28: error: 'current_tags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9931 |         ((0x1 << tmp_slot) & current_tags)) {
          |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
    ../../common/io/sata/adapters/ahci/ahci.c:9928:45: error: 'current_slot' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     9928 |     if (NON_NCQ_CMD_IN_PROGRESS(ahci_portp) &&
    cc1: all warnings being treated as errors

Testing done: build/install/boot.

History

#1

Updated by Toomas Soome about 1 month ago

  • Description updated (diff)
#2

Updated by Electric Monk about 1 month ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit bc576fff266b5ed3db0ef5d8196b7440cdefbb8b

commit  bc576fff266b5ed3db0ef5d8196b7440cdefbb8b
Author: Toomas Soome <tsoome@me.com>
Date:   2020-03-04T06:24:32.000Z

    12325 ahci: variable may be used uninitialized
    Reviewed by: Matthias Scheler <mscheler@tintri.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF