]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rfkill: fix static analyzer warning [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2021 10:09:31 +0000 (11:09 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2021 10:09:31 +0000 (11:09 +0100)
>>>     CID 365738:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "ret". Field "ret" is uninitialized.
326             return ret;

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/rfkill.c

index 73fb4bab408346b1a955dec4b9dcc0affe63ee89..9b134444a99325a12306ab3f949db50e790822fa 100644 (file)
@@ -295,7 +295,7 @@ done:
 static struct rfkill_id rfkill_id_to_type(const char *s)
 {
        const struct rfkill_type_str *p;
-       struct rfkill_id ret;
+       struct rfkill_id ret = { .result = 0 };
 
        if (islower(*s)) {
                for (p = rfkill_type_strings; p->name != NULL; p++) {