aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2009-03-05 13:40:27 -0500
committerPierre Ossman <drzeus@drzeus.cx>2009-03-24 16:30:00 -0400
commitbe6f19fc24c937112d251232b3dae7e05e96aad1 (patch)
treed7c94b0b797e0f1f84c903c0101b29ef025460fd /drivers/mmc
parentc8d718f1037950107f13607ff0b696ffe63df76a (diff)
sdio: check that addresses are within the address space
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-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));