aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/target/iscsi/iscsi_target.c37
1 files changed, 10 insertions, 27 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 3cf9fb54b7d4..16750da1584a 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -129,10 +129,8 @@ struct iscsi_tiqn *iscsit_add_tiqn(unsigned char *buf)
129 } 129 }
130 130
131 tiqn = kzalloc(sizeof(struct iscsi_tiqn), GFP_KERNEL); 131 tiqn = kzalloc(sizeof(struct iscsi_tiqn), GFP_KERNEL);
132 if (!tiqn) { 132 if (!tiqn)
133 pr_err("Unable to allocate struct iscsi_tiqn\n");
134 return ERR_PTR(-ENOMEM); 133 return ERR_PTR(-ENOMEM);
135 }
136 134
137 sprintf(tiqn->tiqn, "%s", buf); 135 sprintf(tiqn->tiqn, "%s", buf);
138 INIT_LIST_HEAD(&tiqn->tiqn_list); 136 INIT_LIST_HEAD(&tiqn->tiqn_list);
@@ -364,7 +362,6 @@ struct iscsi_np *iscsit_add_np(
364 362
365 np = kzalloc(sizeof(struct iscsi_np), GFP_KERNEL); 363 np = kzalloc(sizeof(struct iscsi_np), GFP_KERNEL);
366 if (!np) { 364 if (!np) {
367 pr_err("Unable to allocate memory for struct iscsi_np\n");
368 mutex_unlock(&np_lock); 365 mutex_unlock(&np_lock);
369 return ERR_PTR(-ENOMEM); 366 return ERR_PTR(-ENOMEM);
370 } 367 }
@@ -698,10 +695,9 @@ static int __init iscsi_target_init_module(void)
698 pr_debug("iSCSI-Target "ISCSIT_VERSION"\n"); 695 pr_debug("iSCSI-Target "ISCSIT_VERSION"\n");
699 696
700 iscsit_global = kzalloc(sizeof(struct iscsit_global), GFP_KERNEL); 697 iscsit_global = kzalloc(sizeof(struct iscsit_global), GFP_KERNEL);
701 if (!iscsit_global) { 698 if (!iscsit_global)
702 pr_err("Unable to allocate memory for iscsit_global\n");
703 return -1; 699 return -1;
704 } 700
705 spin_lock_init(&iscsit_global->ts_bitmap_lock); 701 spin_lock_init(&iscsit_global->ts_bitmap_lock);
706 mutex_init(&auth_id_lock); 702 mutex_init(&auth_id_lock);
707 spin_lock_init(&sess_idr_lock); 703 spin_lock_init(&sess_idr_lock);
@@ -714,10 +710,8 @@ static int __init iscsi_target_init_module(void)
714 710
715 size = BITS_TO_LONGS(ISCSIT_BITMAP_BITS) * sizeof(long); 711 size = BITS_TO_LONGS(ISCSIT_BITMAP_BITS) * sizeof(long);
716 iscsit_global->ts_bitmap = vzalloc(size); 712 iscsit_global->ts_bitmap = vzalloc(size);
717 if (!iscsit_global->ts_bitmap) { 713 if (!iscsit_global->ts_bitmap)
718 pr_err("Unable to allocate iscsit_global->ts_bitmap\n");
719 goto configfs_out; 714 goto configfs_out;
720 }
721 715
722 lio_qr_cache = kmem_cache_create("lio_qr_cache", 716 lio_qr_cache = kmem_cache_create("lio_qr_cache",
723 sizeof(struct iscsi_queue_req), 717 sizeof(struct iscsi_queue_req),
@@ -985,10 +979,8 @@ static int iscsit_allocate_iovecs(struct iscsi_cmd *cmd)
985 979
986 iov_count += ISCSI_IOV_DATA_BUFFER; 980 iov_count += ISCSI_IOV_DATA_BUFFER;
987 cmd->iov_data = kcalloc(iov_count, sizeof(*cmd->iov_data), GFP_KERNEL); 981 cmd->iov_data = kcalloc(iov_count, sizeof(*cmd->iov_data), GFP_KERNEL);
988 if (!cmd->iov_data) { 982 if (!cmd->iov_data)
989 pr_err("Unable to allocate cmd->iov_data\n");
990 return -ENOMEM; 983 return -ENOMEM;
991 }
992 984
993 cmd->orig_iov_data_count = iov_count; 985 cmd->orig_iov_data_count = iov_count;
994 return 0; 986 return 0;
@@ -1849,8 +1841,6 @@ static int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
1849 1841
1850 ping_data = kzalloc(payload_length + 1, GFP_KERNEL); 1842 ping_data = kzalloc(payload_length + 1, GFP_KERNEL);
1851 if (!ping_data) { 1843 if (!ping_data) {
1852 pr_err("Unable to allocate memory for"
1853 " NOPOUT ping data.\n");
1854 ret = -1; 1844 ret = -1;
1855 goto out; 1845 goto out;
1856 } 1846 }
@@ -1998,13 +1988,10 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
1998 cmd->data_direction = DMA_NONE; 1988 cmd->data_direction = DMA_NONE;
1999 1989
2000 cmd->tmr_req = kzalloc(sizeof(struct iscsi_tmr_req), GFP_KERNEL); 1990 cmd->tmr_req = kzalloc(sizeof(struct iscsi_tmr_req), GFP_KERNEL);
2001 if (!cmd->tmr_req) { 1991 if (!cmd->tmr_req)
2002 pr_err("Unable to allocate memory for"
2003 " Task Management command!\n");
2004 return iscsit_add_reject_cmd(cmd, 1992 return iscsit_add_reject_cmd(cmd,
2005 ISCSI_REASON_BOOKMARK_NO_RESOURCES, 1993 ISCSI_REASON_BOOKMARK_NO_RESOURCES,
2006 buf); 1994 buf);
2007 }
2008 1995
2009 /* 1996 /*
2010 * TASK_REASSIGN for ERL=2 / connection stays inside of 1997 * TASK_REASSIGN for ERL=2 / connection stays inside of
@@ -2264,11 +2251,9 @@ iscsit_handle_text_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
2264 struct kvec iov[3]; 2251 struct kvec iov[3];
2265 2252
2266 text_in = kzalloc(payload_length, GFP_KERNEL); 2253 text_in = kzalloc(payload_length, GFP_KERNEL);
2267 if (!text_in) { 2254 if (!text_in)
2268 pr_err("Unable to allocate memory for"
2269 " incoming text parameters\n");
2270 goto reject; 2255 goto reject;
2271 } 2256
2272 cmd->text_in_ptr = text_in; 2257 cmd->text_in_ptr = text_in;
2273 2258
2274 memset(iov, 0, 3 * sizeof(struct kvec)); 2259 memset(iov, 0, 3 * sizeof(struct kvec));
@@ -3352,11 +3337,9 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
3352 SENDTARGETS_BUF_LIMIT); 3337 SENDTARGETS_BUF_LIMIT);
3353 3338
3354 payload = kzalloc(buffer_len, GFP_KERNEL); 3339 payload = kzalloc(buffer_len, GFP_KERNEL);
3355 if (!payload) { 3340 if (!payload)
3356 pr_err("Unable to allocate memory for sendtargets"
3357 " response.\n");
3358 return -ENOMEM; 3341 return -ENOMEM;
3359 } 3342
3360 /* 3343 /*
3361 * Locate pointer to iqn./eui. string for ICF_SENDTARGETS_SINGLE 3344 * Locate pointer to iqn./eui. string for ICF_SENDTARGETS_SINGLE
3362 * explicit case.. 3345 * explicit case..