forked from luck/tmp_suning_uos_patched
2874c5fd28
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34 lines
729 B
C
34 lines
729 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
*/
|
|
#include <linux/module.h>
|
|
#include <net/checksum.h>
|
|
|
|
#include <asm/byteorder.h>
|
|
|
|
/*
|
|
* copy from fs while checksumming, otherwise like csum_partial
|
|
*/
|
|
__wsum
|
|
csum_partial_copy_from_user(const void __user *src, void *dst, int len,
|
|
__wsum sum, int *csum_err)
|
|
{
|
|
int missing;
|
|
|
|
missing = __copy_from_user(dst, src, len);
|
|
if (missing) {
|
|
memset(dst + len - missing, 0, missing);
|
|
*csum_err = -EFAULT;
|
|
} else
|
|
*csum_err = 0;
|
|
|
|
return csum_partial(dst, len, sum);
|
|
}
|
|
EXPORT_SYMBOL(csum_partial_copy_from_user);
|
|
|
|
/* These are from csum_64plus.S */
|
|
EXPORT_SYMBOL(csum_partial);
|
|
EXPORT_SYMBOL(csum_partial_copy);
|
|
EXPORT_SYMBOL(ip_compute_csum);
|
|
EXPORT_SYMBOL(ip_fast_csum);
|