From owner-svn-src-head@freebsd.org Mon Jan 4 21:07:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144F4A61A3E; Mon, 4 Jan 2016 21:07:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D94E41D73; Mon, 4 Jan 2016 21:07:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u04L79GR045158; Mon, 4 Jan 2016 21:07:09 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u04L78vS045157; Mon, 4 Jan 2016 21:07:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201601042107.u04L78vS045157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 4 Jan 2016 21:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293178 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2016 21:07:10 -0000 Author: avos Date: Mon Jan 4 21:07:08 2016 New Revision: 293178 URL: https://svnweb.freebsd.org/changeset/base/293178 Log: iwm: free firmware related resources after uploading it to the hardware iwn(4) / wpi(4) works in the same way (read_firmware() -> hw_init() -> firmware_put()) Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4766 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:03:01 2016 (r293177) +++ head/sys/dev/iwm/if_iwm.c Mon Jan 4 21:07:08 2016 (r293178) @@ -2041,6 +2041,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm sc->sc_uc_current = ucode_type; error = iwm_start_fw(sc, ucode_type); + iwm_fw_info_free(&sc->sc_fw); if (error) { sc->sc_uc_current = old_type; return error; @@ -4936,7 +4937,6 @@ iwm_suspend(device_t dev) static int iwm_detach_local(struct iwm_softc *sc, int do_net80211) { - struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; @@ -4953,11 +4953,7 @@ iwm_detach_local(struct iwm_softc *sc, i for (i = 0; i < nitems(sc->txq); i++) iwm_free_tx_ring(sc, &sc->txq[i]); - /* Free firmware */ - if (fw->fw_fp != NULL) - iwm_fw_info_free(fw); - - /* free scheduler */ + /* Free scheduler */ iwm_free_sched(sc); if (sc->ict_dma.vaddr != NULL) iwm_free_ict(sc);