From: Nigel Croxon Date: Wed, 22 May 2024 20:05:25 +0000 (-0400) Subject: mdadm: super-intel remove dead code X-Git-Tag: mdadm-4.4~175 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=49145d4f574b21a6c0612ce691f255732cb91832;p=mdadm.git mdadm: super-intel remove dead code 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 --- diff --git a/super-intel.c b/super-intel.c index 95856322..d1b737c7 100644 --- a/super-intel.c +++ b/super-intel.c @@ -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; }