Skip to content

Commit 32f5903

Browse files
committed
Silence GCC warnings about possibly uninitialized blob values
In fact, the blob is always initialized when get_attr_blob() returns KDUMP_OK, but the C compiler is not smart enough to know, but it is a bad habit to ignore compiler warnings. An unnecessary NULL initialization is definitely cheaper. ;-) Signed-off-by: Petr Tesarik <[email protected]>
1 parent 9646696 commit 32f5903

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/kdumpfile/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ derived_attr_revalidate(kdump_ctx_t *ctx, struct attr_data *attr,
10681068
const struct attr_template *tmpl)
10691069
{
10701070
const struct derived_attr_def *def = attr_to_derived_def(attr);
1071-
kdump_blob_t *blob;
1071+
kdump_blob_t *blob = NULL;
10721072
kdump_status status;
10731073
void *ptr;
10741074

@@ -1122,7 +1122,7 @@ derived_attr_update(kdump_ctx_t *ctx, struct attr_data *attr,
11221122
const struct attr_template *tmpl)
11231123
{
11241124
const struct derived_attr_def *def = attr_to_derived_def(attr);
1125-
kdump_blob_t *blob;
1125+
kdump_blob_t *blob = NULL;
11261126
kdump_status status;
11271127
void *ptr;
11281128

0 commit comments

Comments
 (0)