diff mbox series

fwts_acpi_tables: NULLify table pointers

Message ID 20210922081148.38093-1-colin.king@canonical.com
State Accepted
Headers show
Series fwts_acpi_tables: NULLify table pointers | expand

Commit Message

Colin Ian King Sept. 22, 2021, 8:11 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Clear up some overly pedantic coverity warnings that seem to be
false positives but it's good practice to initialize the pointers
anyhow.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_acpi_tables.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alex Hung Sept. 22, 2021, 7:05 p.m. UTC | #1
On 2021-09-22 2:11 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Clear up some overly pedantic coverity warnings that seem to be
> false positives but it's good practice to initialize the pointers
> anyhow.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_acpi_tables.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 9f12539f..79f019a2 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -300,7 +300,7 @@ int fwts_acpi_free_tables(void)
>   */
>  fwts_bool fwts_acpi_is_reduced_hardware(fwts_framework *fw)
>  {
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  	const fwts_acpi_table_fadt *fadt;
>  
>  	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK) {
> @@ -969,7 +969,7 @@ void fwts_acpi_fixup_addr_from_fadt(
>  	uint32_t addr32,
>  	uint64_t addr64)
>  {
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  
>  	/* Fetch the table */
>  	if (fwts_acpi_find_table(fw, name, 0, &table) != FWTS_OK)
> @@ -999,7 +999,7 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>  {
>  	int i, j, count;
>  	char *oem_tbl_id;
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  	fwts_acpi_table_rsdp *rsdp = NULL;
>  	fwts_acpi_table_fadt *fadt = NULL;
>  	uint64_t rsdt_fake_addr = 0, xsdt_fake_addr = 0;
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Sept. 23, 2021, 2:36 a.m. UTC | #2
On 9/22/21 4:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Clear up some overly pedantic coverity warnings that seem to be
> false positives but it's good practice to initialize the pointers
> anyhow.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/lib/src/fwts_acpi_tables.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
> index 9f12539f..79f019a2 100644
> --- a/src/lib/src/fwts_acpi_tables.c
> +++ b/src/lib/src/fwts_acpi_tables.c
> @@ -300,7 +300,7 @@ int fwts_acpi_free_tables(void)
>   */
>  fwts_bool fwts_acpi_is_reduced_hardware(fwts_framework *fw)
>  {
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  	const fwts_acpi_table_fadt *fadt;
>  
>  	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK) {
> @@ -969,7 +969,7 @@ void fwts_acpi_fixup_addr_from_fadt(
>  	uint32_t addr32,
>  	uint64_t addr64)
>  {
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  
>  	/* Fetch the table */
>  	if (fwts_acpi_find_table(fw, name, 0, &table) != FWTS_OK)
> @@ -999,7 +999,7 @@ static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
>  {
>  	int i, j, count;
>  	char *oem_tbl_id;
> -	fwts_acpi_table_info *table;
> +	fwts_acpi_table_info *table = NULL;
>  	fwts_acpi_table_rsdp *rsdp = NULL;
>  	fwts_acpi_table_fadt *fadt = NULL;
>  	uint64_t rsdt_fake_addr = 0, xsdt_fake_addr = 0;
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 9f12539f..79f019a2 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -300,7 +300,7 @@  int fwts_acpi_free_tables(void)
  */
 fwts_bool fwts_acpi_is_reduced_hardware(fwts_framework *fw)
 {
-	fwts_acpi_table_info *table;
+	fwts_acpi_table_info *table = NULL;
 	const fwts_acpi_table_fadt *fadt;
 
 	if (fwts_acpi_find_table(fw, "FACP", 0, &table) != FWTS_OK) {
@@ -969,7 +969,7 @@  void fwts_acpi_fixup_addr_from_fadt(
 	uint32_t addr32,
 	uint64_t addr64)
 {
-	fwts_acpi_table_info *table;
+	fwts_acpi_table_info *table = NULL;
 
 	/* Fetch the table */
 	if (fwts_acpi_find_table(fw, name, 0, &table) != FWTS_OK)
@@ -999,7 +999,7 @@  static int fwts_acpi_load_tables_fixup(fwts_framework *fw)
 {
 	int i, j, count;
 	char *oem_tbl_id;
-	fwts_acpi_table_info *table;
+	fwts_acpi_table_info *table = NULL;
 	fwts_acpi_table_rsdp *rsdp = NULL;
 	fwts_acpi_table_fadt *fadt = NULL;
 	uint64_t rsdt_fake_addr = 0, xsdt_fake_addr = 0;