git: e9fe7b08eb2e - stable/14 - sys/intpm: fix SMBus Read Block
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 19 May 2025 12:53:36 UTC
The branch stable/14 has been updated by corvink:
URL: https://cgit.FreeBSD.org/src/commit/?id=e9fe7b08eb2e33112187250795dc3cb0881bf71a
commit e9fe7b08eb2e33112187250795dc3cb0881bf71a
Author: Corvin Köhne <corvink@FreeBSD.org>
AuthorDate: 2025-05-05 09:23:18 +0000
Commit: Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2025-05-19 12:53:00 +0000
sys/intpm: fix SMBus Read Block
The Read Block function missed saving the data into the preallocated
buffer. This causes it to return some garbage when called.
Reviewed by: avg
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Pull Request: https://github.com/freebsd/freebsd-src/pull/1691
(cherry picked from commit 691833ad3776c17ba3267049ac36bc3461c66799)
---
sys/dev/intpm/intpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/intpm/intpm.c b/sys/dev/intpm/intpm.c
index 92fd4dcebb03..bcc7ac06e975 100644
--- a/sys/dev/intpm/intpm.c
+++ b/sys/dev/intpm/intpm.c
@@ -859,7 +859,7 @@ intsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
if (nread != 0 && nread <= SMBBLOCKTRANS_MAX) {
*count = nread;
for (i = 0; i < nread; i++)
- bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
+ buf[i] = bus_read_1(sc->io_res, PIIX4_SMBBLKDAT);
} else
error = SMB_EBUSERR;
}