dm integrity: don't check null pointer before kvfree and vfree
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 29 Apr 2019 12:57:17 +0000 (14:57 +0200)
committerMike Snitzer <snitzer@redhat.com>
Tue, 7 May 2019 20:05:08 +0000 (16:05 -0400)
The functions kfree, vfree and kvfree do nothing if we pass a NULL
pointer to them.  So we don't need to test the pointer for NULL.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-integrity.c

index 7848ef0198804acb383167591903db77b47b9f60..1e73422c04bcb62357bfac46ef8dc37970e01e06 100644 (file)
@@ -3548,10 +3548,8 @@ static void dm_integrity_dtr(struct dm_target *ti)
                destroy_workqueue(ic->writer_wq);
        if (ic->recalc_wq)
                destroy_workqueue(ic->recalc_wq);
-       if (ic->recalc_buffer)
-               vfree(ic->recalc_buffer);
-       if (ic->recalc_tags)
-               kvfree(ic->recalc_tags);
+       vfree(ic->recalc_buffer);
+       kvfree(ic->recalc_tags);
        if (ic->bufio)
                dm_bufio_client_destroy(ic->bufio);
        mempool_exit(&ic->journal_io_mempool);