git: 3ce981ee8ef7 - stable/13 - LinuxKPI: fix bug in le32p_replace_bits()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Fri, 19 Nov 2021 00:02:19 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=3ce981ee8ef7b343779f445ba833d93596edf5d9

commit 3ce981ee8ef7b343779f445ba833d93596edf5d9
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-07-29 21:27:21 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-11-19 00:01:23 +0000

    LinuxKPI: fix bug in le32p_replace_bits()
    
    Fix a bug that slipped in in 90707c4e44de03ea36be183ef2226601c66169cb
    using the correct field in le32p_replace_bits().
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 22e20d852ff400a486da24e5d1d92c841a3e39d9)
---
 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)