Messages in this thread |  | | | Date | Thu, 27 Dec 2007 18:54:12 +1100 (EST) | | From | James Morris <> | | Subject | Re: [PATCH] Exporting capability code/name pairs | |
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
<jmorris@namei.org>
|  |