]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
mdadm: super-intel remove dead code
authorNigel Croxon <ncroxon@redhat.com>
Wed, 22 May 2024 20:05:25 +0000 (16:05 -0400)
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Thu, 23 May 2024 10:35:21 +0000 (12:35 +0200)
Execution cannot reach this statement: "while (devlist) { dv = de...".
Local variable "err" is assigned only once, to a constant value,
making it effectively constant throughout its scope.
Remove dead code.

Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
super-intel.c

index 958563229d23a430e0ff27381a19e418ae20e586..d1b737c7fe5b766027a8c44777e00d2e2dce8bc9 100644 (file)
@@ -7046,7 +7046,6 @@ get_devices(const char *hba_path)
        struct md_list *dv;
        struct dirent *ent;
        DIR *dir;
-       int err = 0;
 
 #if DEBUG_LOOP
        devlist = get_loop_devices();
@@ -7088,14 +7087,6 @@ get_devices(const char *hba_path)
                dv->next = devlist;
                devlist = dv;
        }
-       if (err) {
-               while(devlist) {
-                       dv = devlist;
-                       devlist = devlist->next;
-                       free(dv->devname);
-                       free(dv);
-               }
-       }
        closedir(dir);
        return devlist;
 }