git: 22e20d852ff4 - main - LinuxKPI: fix bug in le32p_replace_bits()

Bjoern A. Zeeb bz at FreeBSD.org
Sat Jul 31 22:18:40 UTC 2021


The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=22e20d852ff400a486da24e5d1d92c841a3e39d9

commit 22e20d852ff400a486da24e5d1d92c841a3e39d9
Author:     Bjoern A. Zeeb <bz at FreeBSD.org>
AuthorDate: 2021-07-29 21:27:21 +0000
Commit:     Bjoern A. Zeeb <bz at FreeBSD.org>
CommitDate: 2021-07-31 22:15:35 +0000

    LinuxKPI: fix bug in le32p_replace_bits()
    
    Fix a bug that slipped in in 90707c4e44de03ea36be183ef2226601c66169cb
    using the correct field in le32p_replace_bits().
    
    MFC after:      3 days
    Reviewed by:    hselasky
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D31352
---
 sys/compat/linuxkpi/common/include/linux/bitfield.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/bitfield.h b/sys/compat/linuxkpi/common/include/linux/bitfield.h
index 27082cbd4886..a805c1bca5a1 100644
--- a/sys/compat/linuxkpi/common/include/linux/bitfield.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitfield.h
@@ -90,7 +90,7 @@ static __inline void
 le32p_replace_bits(uint32_t *p, uint32_t v, uint32_t f)
 {
 
-	*p = (*p & ~(cpu_to_le32(v))) | le32_encode_bits(v, f);
+	*p = (*p & ~(cpu_to_le32(f))) | le32_encode_bits(v, f);
 }
 
 #define	__bf_shf(x)	(__builtin_ffsll(x) - 1)


More information about the dev-commits-src-main mailing list