summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPhilip J Kelleher <pjk1939@linux.vnet.ibm.com>2013-06-18 21:48:38 +0200
committerJens Axboe <axboe@kernel.dk>2013-06-19 13:52:10 +0200
commit3eb8dcafb5a73041e2f3b4a39c057a58e4354d83 (patch)
tree754d303661b0de51c248a57bea2991d9c4a55018 /drivers/block
parentrsxx: Fixes DLPAR add kernel panic if partition still mounted. (diff)
downloadlinux-3eb8dcafb5a73041e2f3b4a39c057a58e4354d83.tar.xz
linux-3eb8dcafb5a73041e2f3b4a39c057a58e4354d83.zip
rsxx: Adapter address space sanity check.
Adding a sanity check to guarentee that DMAs outside of the device's address space will be errored out right away. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rsxx/dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/rsxx/dev.c b/drivers/block/rsxx/dev.c
index a092f58db212..d7af441880be 100644
--- a/drivers/block/rsxx/dev.c
+++ b/drivers/block/rsxx/dev.c
@@ -174,6 +174,9 @@ static void rsxx_make_request(struct request_queue *q, struct bio *bio)
if (!card)
goto req_err;
+ if (bio->bi_sector + (bio->bi_size >> 9) > get_capacity(card->gendisk))
+ goto req_err;
+
if (unlikely(card->halt)) {
st = -EFAULT;
goto req_err;