Commit 3c097193 authored by Sumit Kumar's avatar Sumit Kumar Committed by Greg Kroah-Hartman

staging: gasket: remove null ptr check before kfree

Remove null ptr check before kfree because kfree is null ptr safe.
Issue found by checkpatch.
Signed-off-by: default avatarSumit Kumar <sumit686215@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b2424d9
...@@ -1328,10 +1328,8 @@ int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size, ...@@ -1328,10 +1328,8 @@ int gasket_alloc_coherent_memory(struct gasket_dev *gasket_dev, u64 size,
num_pages * PAGE_SIZE, mem, handle); num_pages * PAGE_SIZE, mem, handle);
} }
if (gasket_dev->page_table[index]->coherent_pages) {
kfree(gasket_dev->page_table[index]->coherent_pages); kfree(gasket_dev->page_table[index]->coherent_pages);
gasket_dev->page_table[index]->coherent_pages = NULL; gasket_dev->page_table[index]->coherent_pages = NULL;
}
gasket_dev->page_table[index]->num_coherent_pages = 0; gasket_dev->page_table[index]->num_coherent_pages = 0;
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment