aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/mmc_ops.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 9a6181bf0c06..e04008f6fc24 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -264,20 +264,6 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
264 struct mmc_command cmd = {0}; 264 struct mmc_command cmd = {0};
265 struct mmc_data data = {0}; 265 struct mmc_data data = {0};
266 struct scatterlist sg; 266 struct scatterlist sg;
267 void *data_buf;
268 int is_on_stack;
269
270 is_on_stack = object_is_on_stack(buf);
271 if (is_on_stack) {
272 /*
273 * dma onto stack is unsafe/nonportable, but callers to this
274 * routine normally provide temporary on-stack buffers ...
275 */
276 data_buf = kmalloc(len, GFP_KERNEL);
277 if (!data_buf)
278 return -ENOMEM;
279 } else
280 data_buf = buf;
281 267
282 mrq.cmd = &cmd; 268 mrq.cmd = &cmd;
283 mrq.data = &data; 269 mrq.data = &data;
@@ -298,7 +284,7 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
298 data.sg = &sg; 284 data.sg = &sg;
299 data.sg_len = 1; 285 data.sg_len = 1;
300 286
301 sg_init_one(&sg, data_buf, len); 287 sg_init_one(&sg, buf, len);
302 288
303 if (opcode == MMC_SEND_CSD || opcode == MMC_SEND_CID) { 289 if (opcode == MMC_SEND_CSD || opcode == MMC_SEND_CID) {
304 /* 290 /*
@@ -312,11 +298,6 @@ mmc_send_cxd_data(struct mmc_card *card, struct mmc_host *host,
312 298
313 mmc_wait_for_req(host, &mrq); 299 mmc_wait_for_req(host, &mrq);
314 300
315 if (is_on_stack) {
316 memcpy(buf, data_buf, len);
317 kfree(data_buf);
318 }
319
320 if (cmd.error) 301 if (cmd.error)
321 return cmd.error; 302 return cmd.error;
322 if (data.error) 303 if (data.error)