Page MenuHomeFreeBSD

D44585.diff
No OneTemporary

D44585.diff

diff --git a/sys/kern/subr_stats.c b/sys/kern/subr_stats.c
--- a/sys/kern/subr_stats.c
+++ b/sys/kern/subr_stats.c
@@ -1078,9 +1078,9 @@
stats_v1_blob_clone(struct statsblobv1 **dst, size_t dstmaxsz,
struct statsblobv1 *src, uint32_t flags)
{
- int error;
+ int error, tmperror;
- error = 0;
+ error = tmperror = 0;
if (src == NULL || dst == NULL ||
src->cursz < sizeof(struct statsblob) ||
@@ -1131,14 +1131,16 @@
}
#ifdef _KERNEL
if (flags & SB_CLONE_USRDSTNOFAULT)
- error = copyout_nofault(&(src->cursz), &((*dst)->cursz),
+ tmperror = copyout_nofault(&(src->cursz), &((*dst)->cursz),
postcurszlen);
else if (flags & SB_CLONE_USRDST)
- error = copyout(&(src->cursz), &((*dst)->cursz),
+ tmperror = copyout(&(src->cursz), &((*dst)->cursz),
postcurszlen);
else
#endif
memcpy(&((*dst)->cursz), &(src->cursz), postcurszlen);
+
+ error = error ? error : tmperror;
}
#ifdef _KERNEL
out:

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 27, 10:08 PM (8 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16216159
Default Alt Text
D44585.diff (952 B)

Event Timeline