2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 18:23:53 +08:00

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: Sumit Kumar <sumit686215@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sumit Kumar 2018-08-12 12:38:19 +05:30 committed by Greg Kroah-Hartman
parent 2b2424d9a7
commit 3c0971939e

View File

@ -1328,10 +1328,8 @@ nomem:
num_pages * PAGE_SIZE, mem, handle);
}
if (gasket_dev->page_table[index]->coherent_pages) {
kfree(gasket_dev->page_table[index]->coherent_pages);
gasket_dev->page_table[index]->coherent_pages = NULL;
}
kfree(gasket_dev->page_table[index]->coherent_pages);
gasket_dev->page_table[index]->coherent_pages = NULL;
gasket_dev->page_table[index]->num_coherent_pages = 0;
return -ENOMEM;
}