um: Remove redundant NULL check
authorLi Heng <liheng40@huawei.com>
Thu, 23 Jul 2020 03:15:16 +0000 (11:15 +0800)
committerRichard Weinberger <richard@nod.at>
Sun, 11 Oct 2020 21:19:35 +0000 (23:19 +0200)
Fix below warnings reported by coccicheck:
./arch/um/drivers/vector_user.c:403:2-7: WARNING: NULL check before some freeing functions is not needed.

Fixes: bc8f8e4e6e7a ("um: Add a generic "fd" vector transport")
Signed-off-by: Li Heng <liheng40@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_user.c

index 090ff93..65b6a71 100644 (file)
@@ -397,8 +397,7 @@ static struct vector_fds *user_init_fd_fds(struct arglist *ifspec)
 fd_cleanup:
        if (fd >= 0)
                os_close_file(fd);
-       if (result != NULL)
-               kfree(result);
+       kfree(result);
        return NULL;
 }