diff options
author | Yang Li <abaci-bugfix@linux.alibaba.com> | 2021-02-24 21:05:00 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-02-24 22:38:30 +0100 |
commit | fb9bf0484af4770240342f4d1b3dd054889cc31e (patch) | |
tree | 9fb82b4c909b2e6e856e2ec4a5cf2143df6cbeae /fs/proc | |
parent | mm/page_reporting: use list_entry_is_head() in page_reporting_cycle() (diff) | |
download | linux-fb9bf0484af4770240342f4d1b3dd054889cc31e.tar.xz linux-fb9bf0484af4770240342f4d1b3dd054889cc31e.zip |
vmalloc: remove redundant NULL check
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>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/vmcore.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index c3a345c28a93..9a15334da208 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -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; } |