summaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2010-04-26 21:56:19 +0400
committerAnton Vorontsov <cbouatmailru@gmail.com>2010-04-26 21:56:19 +0400
commit8ef1bb539203629f77a61976e4f25415e1083bff (patch)
tree4fee25aca0928f112716fb02d27b1b355d0843b4 /drivers/char/mem.c
parenta3bcbbee83f55cbaec9b2ad748e7300c7feb2192 (diff)
parentb91ce4d14a21fc04d165be30319541e0f9204f15 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 1f3215ac085..f54dab8acdc 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -225,6 +225,7 @@ int __weak phys_mem_access_prot_allowed(struct file *file,
* outside of main memory.
*
*/
+#ifdef pgprot_noncached
static int uncached_access(struct file *file, unsigned long addr)
{
#if defined(CONFIG_IA64)
@@ -251,6 +252,7 @@ static int uncached_access(struct file *file, unsigned long addr)
return addr >= __pa(high_memory);
#endif
}
+#endif
static pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot)
@@ -710,11 +712,6 @@ static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
switch (orig) {
case SEEK_CUR:
offset += file->f_pos;
- if ((unsigned long long)offset <
- (unsigned long long)file->f_pos) {
- ret = -EOVERFLOW;
- break;
- }
case SEEK_SET:
/* to avoid userland mistaking f_pos=-9 as -EBADF=-9 */
if ((unsigned long long)offset >= ~0xFFFULL) {
@@ -908,6 +905,9 @@ static int __init chr_dev_init(void)
printk("unable to get major %d for memory devs\n", MEM_MAJOR);
mem_class = class_create(THIS_MODULE, "mem");
+ if (IS_ERR(mem_class))
+ return PTR_ERR(mem_class);
+
mem_class->devnode = mem_devnode;
for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) {
if (!devlist[minor].name)