lkml.org 
[lkml]   [2004]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][5/6]ELF format dump file access
Hariprasad Nellitheertha <hari@in.ibm.com> wrote:
>
> +/*
> + * Reads from the oldmem device from given offset till
> + * given count
> + */
> +static ssize_t read_from_oldmem(char *buf, size_t count,
> + loff_t *ppos, int userbuf)
> +{
> + unsigned long pfn, p = *ppos;
> + size_t read = 0;
> +
> + pfn = p / PAGE_SIZE;
> + p = p % PAGE_SIZE;
> +
> + if (pfn > saved_max_pfn) {
> + read = -EINVAL;
> + goto done;
> + }
> +
> + if (count > PAGE_SIZE - p)
> + count = PAGE_SIZE - p;
> +
> + if (copy_oldmem_page(pfn, buf, count, userbuf)) {
> + read = -EFAULT;
> + goto done;
> + }
> +
> + *ppos += count;

hm, what's going on here? *ppos is a loff_t but you've copied it
into a 32-bit local prior to calculating the pfn.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans