]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
vmalloc: remove redundant NULL check
authorYang Li <abaci-bugfix@linux.alibaba.com>
Wed, 24 Feb 2021 20:05:00 +0000 (12:05 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 24 Feb 2021 21:38:30 +0000 (13:38 -0800)
Fix below warnings reported by coccicheck:

  fs/proc/vmcore.c:1503:2-7: WARNING: NULL check before some freeing functions is not needed.

Link: https://lkml.kernel.org/r/1611216753-44598-1-git-send-email-abaci-bugfix@linux.alibaba.com
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/vmcore.c

index c3a345c28a9330385ded488ef7a4ea5a4f0abf3b..9a15334da20864c75f3f7ed49f8d4fa077cad2cd 100644 (file)
@@ -1503,11 +1503,8 @@ int vmcore_add_device_dump(struct vmcoredd_data *data)
        return 0;
 
 out_err:
-       if (buf)
-               vfree(buf);
-
-       if (dump)
-               vfree(dump);
+       vfree(buf);
+       vfree(dump);
 
        return ret;
 }