diff options
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 9aadf2fcad6a..a93308ae9736 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -17,7 +17,7 @@ | |||
17 | Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support | 17 | Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support |
18 | */ | 18 | */ |
19 | 19 | ||
20 | static char *verstr = "20050802"; | 20 | static char *verstr = "20050830"; |
21 | 21 | ||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | 23 | ||
@@ -4440,12 +4440,12 @@ static int st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pag | |||
4440 | static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, | 4440 | static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, |
4441 | unsigned long uaddr, size_t count, int rw) | 4441 | unsigned long uaddr, size_t count, int rw) |
4442 | { | 4442 | { |
4443 | unsigned long end = (uaddr + count + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
4444 | unsigned long start = uaddr >> PAGE_SHIFT; | ||
4445 | const int nr_pages = end - start; | ||
4443 | int res, i, j; | 4446 | int res, i, j; |
4444 | unsigned int nr_pages; | ||
4445 | struct page **pages; | 4447 | struct page **pages; |
4446 | 4448 | ||
4447 | nr_pages = ((uaddr & ~PAGE_MASK) + count + ~PAGE_MASK) >> PAGE_SHIFT; | ||
4448 | |||
4449 | /* User attempted Overflow! */ | 4449 | /* User attempted Overflow! */ |
4450 | if ((uaddr + count) < uaddr) | 4450 | if ((uaddr + count) < uaddr) |
4451 | return -EINVAL; | 4451 | return -EINVAL; |