From: Sumit Kumar Date: Sun, 12 Aug 2018 07:08:19 +0000 (+0530) Subject: staging: gasket: remove null ptr check before kfree X-Git-Tag: v4.20-rc1~72^2~521 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3c0971939e5682bf8c20bdf240900d5014107b57;p=linux-block.git 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 Signed-off-by: Greg Kroah-Hartman --- 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; }