Sun Jan 21 04:07:49 2018 UTC ()
CID-1427779: Fix uninitialized variables


(christos)
diff -r1.557 -r1.558 src/sys/dev/pci/if_wm.c

cvs diff -r1.557 -r1.558 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2018/01/18 09:36:26 1.557
+++ src/sys/dev/pci/if_wm.c 2018/01/21 04:07:49 1.558
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.557 2018/01/18 09:36:26 knakahara Exp $ */ 1/* $NetBSD: if_wm.c,v 1.558 2018/01/21 04:07:49 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -73,27 +73,27 @@ @@ -73,27 +73,27 @@
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Check XXX'ed comments 75 * - Check XXX'ed comments
76 * - TX Multi queue improvement (refine queue selection logic) 76 * - TX Multi queue improvement (refine queue selection logic)
77 * - Split header buffer for newer descriptors 77 * - Split header buffer for newer descriptors
78 * - EEE (Energy Efficiency Ethernet) 78 * - EEE (Energy Efficiency Ethernet)
79 * - Virtual Function 79 * - Virtual Function
80 * - Set LED correctly (based on contents in EEPROM) 80 * - Set LED correctly (based on contents in EEPROM)
81 * - Rework how parameters are loaded from the EEPROM. 81 * - Rework how parameters are loaded from the EEPROM.
82 * - Image Unique ID 82 * - Image Unique ID
83 */ 83 */
84 84
85#include <sys/cdefs.h> 85#include <sys/cdefs.h>
86__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.557 2018/01/18 09:36:26 knakahara Exp $"); 86__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.558 2018/01/21 04:07:49 christos Exp $");
87 87
88#ifdef _KERNEL_OPT 88#ifdef _KERNEL_OPT
89#include "opt_net_mpsafe.h" 89#include "opt_net_mpsafe.h"
90#include "opt_if_wm.h" 90#include "opt_if_wm.h"
91#endif 91#endif
92 92
93#include <sys/param.h> 93#include <sys/param.h>
94#include <sys/systm.h> 94#include <sys/systm.h>
95#include <sys/callout.h> 95#include <sys/callout.h>
96#include <sys/mbuf.h> 96#include <sys/mbuf.h>
97#include <sys/malloc.h> 97#include <sys/malloc.h>
98#include <sys/kmem.h> 98#include <sys/kmem.h>
99#include <sys/kernel.h> 99#include <sys/kernel.h>
@@ -12579,27 +12579,27 @@ wm_nvm_version(struct wm_softc *sc) @@ -12579,27 +12579,27 @@ wm_nvm_version(struct wm_softc *sc)
12579 12579
12580 switch (sc->sc_type) { 12580 switch (sc->sc_type) {
12581 case WM_T_82571: 12581 case WM_T_82571:
12582 case WM_T_82572: 12582 case WM_T_82572:
12583 case WM_T_82574: 12583 case WM_T_82574:
12584 case WM_T_82583: 12584 case WM_T_82583:
12585 check_version = true; 12585 check_version = true;
12586 check_optionrom = true; 12586 check_optionrom = true;
12587 have_build = true; 12587 have_build = true;
12588 break; 12588 break;
12589 case WM_T_82575: 12589 case WM_T_82575:
12590 case WM_T_82576: 12590 case WM_T_82576:
12591 case WM_T_82580: 12591 case WM_T_82580:
12592 if ((uid1 & NVM_MAJOR_MASK) != NVM_UID_VALID) 12592 if (have_uid && (uid1 & NVM_MAJOR_MASK) != NVM_UID_VALID)
12593 check_version = true; 12593 check_version = true;
12594 break; 12594 break;
12595 case WM_T_I211: 12595 case WM_T_I211:
12596 wm_nvm_version_invm(sc); 12596 wm_nvm_version_invm(sc);
12597 have_uid = false; 12597 have_uid = false;
12598 goto printver; 12598 goto printver;
12599 case WM_T_I210: 12599 case WM_T_I210:
12600 if (!wm_nvm_get_flash_presence_i210(sc)) { 12600 if (!wm_nvm_get_flash_presence_i210(sc)) {
12601 wm_nvm_version_invm(sc); 12601 wm_nvm_version_invm(sc);
12602 have_uid = false; 12602 have_uid = false;
12603 goto printver; 12603 goto printver;
12604 } 12604 }
12605 /* FALLTHROUGH */ 12605 /* FALLTHROUGH */