mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 12:13:51 -04:00
netfilter: remove redundant null check before kvfree()
kvfree() internally performs NULL check on the pointer handed to it and takes no action if it indeed is NULL. Hence there is no need for a pre-check of the memory pointer before handing it to kvfree(). Issue reported by ifnullfree.cocci Coccinelle semantic patch script. Signed-off-by: Subasri S <subasris1210@gmail.com> Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
committed by
Florian Westphal
parent
1501ab0701
commit
5efbced92e
@@ -544,8 +544,7 @@ static int nft_array_intervals_alloc(struct nft_array *array, u32 max_intervals)
|
||||
if (!intervals)
|
||||
return -ENOMEM;
|
||||
|
||||
if (array->intervals)
|
||||
kvfree(array->intervals);
|
||||
kvfree(array->intervals);
|
||||
|
||||
array->intervals = intervals;
|
||||
array->max_intervals = max_intervals;
|
||||
|
||||
Reference in New Issue
Block a user