diff options
author | Pekka Enberg | 2015-06-30 14:59:24 -0700 |
---|---|---|
committer | Linus Torvalds | 2015-06-30 19:45:00 -0700 |
commit | de64d3a6c7c0cd9cbf673b68fd4a7ae6a2b8f035 (patch) | |
tree | 5b97a7d22ef37cbb181f3186011fe3cb2fb33257 /drivers/target | |
parent | f8c5b93947cd9a6bbc83ef22c060a6cfcc1572b0 (diff) |
target: use kvfree() in session alloc and free
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>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 0b4e24217564..cd3bfc16d25f 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -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); } |