On Thu, 27 Dec 2007, KaiGai Kohei wrote:

(Please put the patch above the .sig separator).

+       len = strlen(tmp);
+
+       if (ofs >= len)
+               return 0;
+
+       if (len - ofs < count)
+               count = len - ofs;
+
+       rc = copy_to_user(buffer, tmp + ofs, count);
+       if (rc)
+               return rc;
+
+       *ppos += count;

Use simple_read_from_buffer().



- James
-- 
James Morris
<[EMAIL PROTECTED]>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to