]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: don't check the value returned from new_file()
authorMasatake YAMATO <yamato@redhat.com>
Sun, 4 Jun 2023 21:31:30 +0000 (06:31 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 4 Jun 2023 21:41:08 +0000 (06:41 +0900)
The funciton newver returns NULL.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd.c

index 9c56460e1321ce09f6fb2a1348081938cd9d909f..05a5f3f4db7c43bc2b1f81874ccd22251647fc88 100644 (file)
@@ -850,9 +850,6 @@ static void parse_maps_line(struct path_cxt *pc, char *buf, struct proc *proc)
                         */
                        goto try_map_files;
                f = new_file(proc, stat2class(&sb));
-               if (!f)
-                       return;
-
                file_set_path(f, &sb, path, -assoc);
        } else {
                /* As used in tcpdump, AF_PACKET socket can be mmap'ed. */
@@ -866,9 +863,6 @@ static void parse_maps_line(struct path_cxt *pc, char *buf, struct proc *proc)
                if (ul_path_readlink(pc, sym, sizeof(sym), map_file) < 0)
                        return;
                f = new_file(proc, stat2class(&sb));
-               if (!f)
-                       return;
-
                file_set_path(f, &sb, sym, -assoc);
        }