aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/sdio_ops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c
index c8fa095a4488..4eb7825fd1a7 100644
--- a/drivers/mmc/core/sdio_ops.c
+++ b/drivers/mmc/core/sdio_ops.c
@@ -76,6 +76,10 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
76 BUG_ON(!card); 76 BUG_ON(!card);
77 BUG_ON(fn > 7); 77 BUG_ON(fn > 7);
78 78
79 /* sanity check */
80 if (addr & ~0x1FFFF)
81 return -EINVAL;
82
79 memset(&cmd, 0, sizeof(struct mmc_command)); 83 memset(&cmd, 0, sizeof(struct mmc_command));
80 84
81 cmd.opcode = SD_IO_RW_DIRECT; 85 cmd.opcode = SD_IO_RW_DIRECT;
@@ -125,6 +129,10 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
125 WARN_ON(blocks == 0); 129 WARN_ON(blocks == 0);
126 WARN_ON(blksz == 0); 130 WARN_ON(blksz == 0);
127 131
132 /* sanity check */
133 if (addr & ~0x1FFFF)
134 return -EINVAL;
135
128 memset(&mrq, 0, sizeof(struct mmc_request)); 136 memset(&mrq, 0, sizeof(struct mmc_request));
129 memset(&cmd, 0, sizeof(struct mmc_command)); 137 memset(&cmd, 0, sizeof(struct mmc_command));
130 memset(&data, 0, sizeof(struct mmc_data)); 138 memset(&data, 0, sizeof(struct mmc_data));