diff options
author | Sumit Kumar <sumit686215@gmail.com> | 2018-08-12 12:38:19 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-27 19:42:32 +0200 |
commit | 3c0971939e5682bf8c20bdf240900d5014107b57 (patch) | |
tree | d0587f43cf86e61cdcb72fd16aaf7192bd7ffe5f /drivers/staging/gasket | |
parent | 2b2424d9a7e35d05cddf94f3e65a375855064505 (diff) |
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>
Diffstat (limited to 'drivers/staging/gasket')
-rw-r--r-- | drivers/staging/gasket/gasket_page_table.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index d4c5f8aa7dd3..bd921dc6094d 100644 --- a/drivers/staging/gasket/gasket_page_table.c +++ b/drivers/staging/gasket/gasket_page_table.c @@ -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; } |