⬢ DragonFlyBSD Kernel Audit
DF-5558 / fix.diff
← back to finding ↓ download raw
--- a/sys/bus/iicbus/iic.c	2026-06-29 12:51:18.000000000 +0000
+++ b/sys/bus/iicbus/iic.c	2026-10-07 16:34:08.516733795 +0000
@@ -365,7 +365,7 @@
 		/* Copyout all read segments, free up kernel buffers */
 		for (i = 0; i < d->nmsgs; i++) {
 			m = &((struct iic_msg *)buf)[i];
-			if (m->flags & IIC_M_RD)
+			if ((m->flags & IIC_M_RD) && error == 0)
 				copyout(m->buf, usrbufs[i], m->len);
 			kfree(m->buf, M_TEMP);
 		}