Message ID | 20210922085602.115111-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | uefirtvariable: clean up pedantic static analysis warnings | expand |
On 2021-09-22 2:56 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Static analysis is warning that attributestest may be uninitialized. > Clean this up by setting the variable to zero. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/uefi/uefirtvariable/uefirtvariable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c > index 9f2b9dfc..095d2f64 100644 > --- a/src/uefi/uefirtvariable/uefirtvariable.c > +++ b/src/uefi/uefirtvariable/uefirtvariable.c > @@ -129,7 +129,7 @@ static int getvariable_test( > uint8_t testdata[MAX_DATA_LENGTH]; > uint64_t dataindex; > uint64_t getdatasize = sizeof(testdata); > - uint32_t attributestest; > + uint32_t attributestest = 0; > > uint8_t data[datasize]; > uint32_t i; > Acked-by: Alex Hung <alex.hung@canonical.com>
On 2021-09-22 2:56 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Static analysis is warning that attributestest may be uninitialized. > Clean this up by setting the variable to zero. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/uefi/uefirtvariable/uefirtvariable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c > index 9f2b9dfc..095d2f64 100644 > --- a/src/uefi/uefirtvariable/uefirtvariable.c > +++ b/src/uefi/uefirtvariable/uefirtvariable.c > @@ -129,7 +129,7 @@ static int getvariable_test( > uint8_t testdata[MAX_DATA_LENGTH]; > uint64_t dataindex; > uint64_t getdatasize = sizeof(testdata); > - uint32_t attributestest; > + uint32_t attributestest = 0; > > uint8_t data[datasize]; > uint32_t i; > Acked-by: Alex Hung <alex.hung@canonical.com>
On 9/22/21 4:56 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Static analysis is warning that attributestest may be uninitialized. > Clean this up by setting the variable to zero. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/uefi/uefirtvariable/uefirtvariable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c > index 9f2b9dfc..095d2f64 100644 > --- a/src/uefi/uefirtvariable/uefirtvariable.c > +++ b/src/uefi/uefirtvariable/uefirtvariable.c > @@ -129,7 +129,7 @@ static int getvariable_test( > uint8_t testdata[MAX_DATA_LENGTH]; > uint64_t dataindex; > uint64_t getdatasize = sizeof(testdata); > - uint32_t attributestest; > + uint32_t attributestest = 0; > > uint8_t data[datasize]; > uint32_t i; > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 9f2b9dfc..095d2f64 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -129,7 +129,7 @@ static int getvariable_test( uint8_t testdata[MAX_DATA_LENGTH]; uint64_t dataindex; uint64_t getdatasize = sizeof(testdata); - uint32_t attributestest; + uint32_t attributestest = 0; uint8_t data[datasize]; uint32_t i;