Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2022 17:58:48 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: d7cd10445841 - stable/13 - sbni: Use memset to clear flags structure in attach.
Message-ID:  <202205131758.24DHwmJJ069544@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

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

commit d7cd104458416be4c8bb9f07cba68d016182a2fe
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-09 00:25:14 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-05-13 17:44:36 +0000

    sbni: Use memset to clear flags structure in attach.
    
    NFC, just less nausea-inducing.
    
    (cherry picked from commit 9c11e6af89c3a9c50e52af5fa2645936dc7eff5d)
---
 sys/dev/sbni/if_sbni_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/sbni/if_sbni_pci.c b/sys/dev/sbni/if_sbni_pci.c
index 10af065d22c5..22ae512a7bdc 100644
--- a/sys/dev/sbni/if_sbni_pci.c
+++ b/sys/dev/sbni/if_sbni_pci.c
@@ -137,7 +137,7 @@ sbni_pci_attach(device_t dev)
 		goto attach_failed;
 	}
 
-	*(u_int32_t*)&flags = 0;
+	memset(&flags, 0, sizeof(flags));
 
 	error = sbni_attach(sc, device_get_unit(dev) * 2, flags);
 	if (error) {



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