summaryrefslogtreecommitdiffstats
path: root/arch/mips/lib/csum_partial_copy.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
commit03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch)
tree88db8dba75ae06ba3bad08e42c5e52efc162535c /arch/mips/lib/csum_partial_copy.c
parent257730f99381dd26e10b832fce4c94cae7ac1176 (diff)
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'arch/mips/lib/csum_partial_copy.c')
-rw-r--r--arch/mips/lib/csum_partial_copy.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c
index ec731b800..5d810b04f 100644
--- a/arch/mips/lib/csum_partial_copy.c
+++ b/arch/mips/lib/csum_partial_copy.c
@@ -14,7 +14,7 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
- * $Id: csum_partial_copy.c,v 1.1 1996/07/03 14:03:47 ralf Exp $
+ * $Id: csum_partial_copy.c,v 1.1 1998/07/10 01:14:49 ralf Exp $
*/
#include <net/checksum.h>
#include <linux/types.h>
@@ -46,7 +46,6 @@ unsigned int csum_partial_copy_from_user (const char *src, char *dst,
int len, unsigned int sum,
int *err_ptr)
{
- int *dst_err_ptr=NULL;
int missing;
missing = copy_from_user(dst, src, len);
@@ -57,3 +56,20 @@ unsigned int csum_partial_copy_from_user (const char *src, char *dst,
return csum_partial(dst, len, sum);
}
+
+/*
+ * Copy to userspace and compute checksum.
+ */
+unsigned int csum_partial_copy_to_user (const char *src, char *dst,
+ int len, unsigned int sum,
+ int *err_ptr)
+{
+ sum = csum_partial(src, len, sum);
+
+ if (copy_to_user(dst, src, len)) {
+ *err_ptr = -EFAULT;
+ return sum;
+ }
+
+ return sum;
+}