Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 May 2025 11:55:26 GMT
From:      Corvin =?utf-8?Q?K=C3=B6hne?= <corvink@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 691833ad3776 - main - sys/intpm: fix SMBus Read Block
Message-ID:  <202505061155.546BtQtr087230@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/src/commit/?id=691833ad3776c17ba3267049ac36bc3461c66799

commit 691833ad3776c17ba3267049ac36bc3461c66799
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-06 11:54:18 +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
---
 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 2f12e0dcf49b..fd3838bbcc14 100644
--- a/sys/dev/intpm/intpm.c
+++ b/sys/dev/intpm/intpm.c
@@ -879,7 +879,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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505061155.546BtQtr087230>