Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/dev/pci Pull up following revision(s) (requested by r...



details:   https://anonhg.NetBSD.org/src/rev/bcba37e1fb31
branches:  netbsd-6
changeset: 774420:bcba37e1fb31
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 12 18:55:10 2012 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #478):
        sys/dev/pci/if_wpi.c: revision 1.53
Fix error branch in wpi(4) firmware loading.
Fixes panic if firmware is not available.

diffstat:

 sys/dev/pci/if_wpi.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 6c301bfd8f8d -r bcba37e1fb31 sys/dev/pci/if_wpi.c
--- a/sys/dev/pci/if_wpi.c      Sun Aug 12 18:53:11 2012 +0000
+++ b/sys/dev/pci/if_wpi.c      Sun Aug 12 18:55:10 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_wpi.c,v 1.50.2.2 2012/05/22 18:36:33 riz Exp $    */
+/*  $NetBSD: if_wpi.c,v 1.50.2.3 2012/08/12 18:55:10 martin Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.50.2.2 2012/05/22 18:36:33 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.50.2.3 2012/08/12 18:55:10 martin Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -1148,7 +1148,7 @@
        /* load firmware image from disk */
        if ((error = firmware_open("if_wpi","iwlwifi-3945.ucode", &fw)) != 0) {
                aprint_error_dev(sc->sc_dev, "could not read firmware file\n");
-               goto fail1;
+               goto fail0;
        }
 
        wpi_firmware_size = firmware_get_size(fw);
@@ -1192,8 +1192,9 @@
        firmware_free(wpi_firmware_image, wpi_firmware_size);
 fail1:
        firmware_close(fw);
-       if (--wpi_firmware_users == 0)
-               firmware_free(wpi_firmware_image, wpi_firmware_size);
+fail0:
+       wpi_firmware_users--;
+       KASSERT(wpi_firmware_users == 0);
        mutex_exit(&wpi_firmware_mutex);
        return error;
 }



Home | Main Index | Thread Index | Old Index