From 0e4489b13044d8edd6854caeb7ada6738a12ff03 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 12 Apr 2024 01:54:21 +0000 Subject: [PATCH] fix non-auto setting of extended media type bits found by smatch warning about uninitialised var use ok jmatthew@ --- sys/dev/pci/if_mcx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_mcx.c b/sys/dev/pci/if_mcx.c index 69049e2a3dd..8005312dcf8 100644 --- a/sys/dev/pci/if_mcx.c +++ b/sys/dev/pci/if_mcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mcx.c,v 1.113 2024/04/11 06:42:12 jmatthew Exp $ */ +/* $OpenBSD: if_mcx.c,v 1.114 2024/04/12 01:54:21 jsg Exp $ */ /* * Copyright (c) 2017 David Gwynne @@ -8108,13 +8108,14 @@ mcx_media_change(struct ifnet *ifp) } } + ext_media = 0; for (i = 0; i < nitems(mcx_ext_eth_cap_map); i++) { const struct mcx_eth_proto_capability *cap; cap = &mcx_ext_eth_cap_map[i]; if (cap->cap_media == IFM_SUBTYPE(sc->sc_media.ifm_media)) { - media = (1 << i); + ext_media = (1 << i); break; } } -- 2.20.1