diff options
| author | Prarit Bhargava <prarit@redhat.com> | 2023-12-04 13:00:37 -0500 | 
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-12-06 21:21:09 +0100 | 
| commit | 72d9b9747e78979510e9aafdd32eb99c7aa30dd1 (patch) | |
| tree | f17c33056e41d7950d9d35d75bba224ae3f86bc8 /drivers/fpga/altera-fpga2sdram.c | |
| parent | 33cc938e65a98f1d29d0a18403dbbee050dcad9a (diff) | |
ACPI: extlog: fix NULL pointer dereference check
The gcc plugin -fanalyzer [1] tries to detect various
patterns of incorrect behaviour.  The tool reports:
drivers/acpi/acpi_extlog.c: In function ‘extlog_exit’:
drivers/acpi/acpi_extlog.c:307:12: warning: check of ‘extlog_l1_addr’ for NULL after already dereferencing it [-Wanalyzer-deref-before-check]
    |
    |  306 |         ((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
    |      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
    |      |                                                  |
    |      |                                                  (1) pointer ‘extlog_l1_addr’ is dereferenced here
    |  307 |         if (extlog_l1_addr)
    |      |            ~
    |      |            |
    |      |            (2) pointer ‘extlog_l1_addr’ is checked for NULL here but it was already dereferenced at (1)
    |
Fix the NULL pointer dereference check in extlog_exit().
Link: https://gcc.gnu.org/onlinedocs/gcc-10.1.0/gcc/Static-Analyzer-Options.html # [1]
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/fpga/altera-fpga2sdram.c')
0 files changed, 0 insertions, 0 deletions
