diff options
-rw-r--r-- | drivers/target/target_core_rd.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c index 026857861107..838dc128d494 100644 --- a/drivers/target/target_core_rd.c +++ b/drivers/target/target_core_rd.c | |||
@@ -48,10 +48,8 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id) | |||
48 | struct rd_host *rd_host; | 48 | struct rd_host *rd_host; |
49 | 49 | ||
50 | rd_host = kzalloc(sizeof(struct rd_host), GFP_KERNEL); | 50 | rd_host = kzalloc(sizeof(struct rd_host), GFP_KERNEL); |
51 | if (!rd_host) { | 51 | if (!rd_host) |
52 | pr_err("Unable to allocate memory for struct rd_host\n"); | ||
53 | return -ENOMEM; | 52 | return -ENOMEM; |
54 | } | ||
55 | 53 | ||
56 | rd_host->rd_host_id = host_id; | 54 | rd_host->rd_host_id = host_id; |
57 | 55 | ||
@@ -148,11 +146,8 @@ static int rd_allocate_sgl_table(struct rd_dev *rd_dev, struct rd_dev_sg_table * | |||
148 | 146 | ||
149 | sg = kcalloc(sg_per_table + chain_entry, sizeof(*sg), | 147 | sg = kcalloc(sg_per_table + chain_entry, sizeof(*sg), |
150 | GFP_KERNEL); | 148 | GFP_KERNEL); |
151 | if (!sg) { | 149 | if (!sg) |
152 | pr_err("Unable to allocate scatterlist array" | ||
153 | " for struct rd_dev\n"); | ||
154 | return -ENOMEM; | 150 | return -ENOMEM; |
155 | } | ||
156 | 151 | ||
157 | sg_init_table(sg, sg_per_table + chain_entry); | 152 | sg_init_table(sg, sg_per_table + chain_entry); |
158 | 153 | ||
@@ -211,11 +206,8 @@ static int rd_build_device_space(struct rd_dev *rd_dev) | |||
211 | 206 | ||
212 | sg_tables = (total_sg_needed / max_sg_per_table) + 1; | 207 | sg_tables = (total_sg_needed / max_sg_per_table) + 1; |
213 | sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); | 208 | sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); |
214 | if (!sg_table) { | 209 | if (!sg_table) |
215 | pr_err("Unable to allocate memory for Ramdisk" | ||
216 | " scatterlist tables\n"); | ||
217 | return -ENOMEM; | 210 | return -ENOMEM; |
218 | } | ||
219 | 211 | ||
220 | rd_dev->sg_table_array = sg_table; | 212 | rd_dev->sg_table_array = sg_table; |
221 | rd_dev->sg_table_count = sg_tables; | 213 | rd_dev->sg_table_count = sg_tables; |
@@ -271,11 +263,8 @@ static int rd_build_prot_space(struct rd_dev *rd_dev, int prot_length, int block | |||
271 | 263 | ||
272 | sg_tables = (total_sg_needed / max_sg_per_table) + 1; | 264 | sg_tables = (total_sg_needed / max_sg_per_table) + 1; |
273 | sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); | 265 | sg_table = kcalloc(sg_tables, sizeof(*sg_table), GFP_KERNEL); |
274 | if (!sg_table) { | 266 | if (!sg_table) |
275 | pr_err("Unable to allocate memory for Ramdisk protection" | ||
276 | " scatterlist tables\n"); | ||
277 | return -ENOMEM; | 267 | return -ENOMEM; |
278 | } | ||
279 | 268 | ||
280 | rd_dev->sg_prot_array = sg_table; | 269 | rd_dev->sg_prot_array = sg_table; |
281 | rd_dev->sg_prot_count = sg_tables; | 270 | rd_dev->sg_prot_count = sg_tables; |
@@ -297,10 +286,8 @@ static struct se_device *rd_alloc_device(struct se_hba *hba, const char *name) | |||
297 | struct rd_host *rd_host = hba->hba_ptr; | 286 | struct rd_host *rd_host = hba->hba_ptr; |
298 | 287 | ||
299 | rd_dev = kzalloc(sizeof(struct rd_dev), GFP_KERNEL); | 288 | rd_dev = kzalloc(sizeof(struct rd_dev), GFP_KERNEL); |
300 | if (!rd_dev) { | 289 | if (!rd_dev) |
301 | pr_err("Unable to allocate memory for struct rd_dev\n"); | ||
302 | return NULL; | 290 | return NULL; |
303 | } | ||
304 | 291 | ||
305 | rd_dev->rd_host = rd_host; | 292 | rd_dev->rd_host = rd_host; |
306 | 293 | ||