]> git.baikalelectronics.ru Git - kernel.git/commitdiff
target: use kvfree() in session alloc and free
authorPekka Enberg <penberg@kernel.org>
Tue, 30 Jun 2015 21:59:24 +0000 (14:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 Jul 2015 02:45:00 +0000 (19:45 -0700)
Use kvfree() instead of open-coding it.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/target/target_core_transport.c

index 0b4e24217564ab902f3dc389deb48acb63c79440..cd3bfc16d25f6eeaf79f757ebf7031e7cbee8ca2 100644 (file)
@@ -279,10 +279,7 @@ int transport_alloc_session_tags(struct se_session *se_sess,
        if (rc < 0) {
                pr_err("Unable to init se_sess->sess_tag_pool,"
                        " tag_num: %u\n", tag_num);
-               if (is_vmalloc_addr(se_sess->sess_cmd_map))
-                       vfree(se_sess->sess_cmd_map);
-               else
-                       kfree(se_sess->sess_cmd_map);
+               kvfree(se_sess->sess_cmd_map);
                se_sess->sess_cmd_map = NULL;
                return -ENOMEM;
        }
@@ -489,10 +486,7 @@ void transport_free_session(struct se_session *se_sess)
 {
        if (se_sess->sess_cmd_map) {
                percpu_ida_destroy(&se_sess->sess_tag_pool);
-               if (is_vmalloc_addr(se_sess->sess_cmd_map))
-                       vfree(se_sess->sess_cmd_map);
-               else
-                       kfree(se_sess->sess_cmd_map);
+               kvfree(se_sess->sess_cmd_map);
        }
        kmem_cache_free(se_sess_cache, se_sess);
 }