From owner-svn-src-all@FreeBSD.ORG Thu Apr 9 16:54:00 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C5BE106564A; Thu, 9 Apr 2009 16:54:00 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0BF8FC14; Thu, 9 Apr 2009 16:53:59 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n39GrxqA010355; Thu, 9 Apr 2009 16:53:59 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n39GrxWW010354; Thu, 9 Apr 2009 16:53:59 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904091653.n39GrxWW010354@svn.freebsd.org> From: Sam Leffler Date: Thu, 9 Apr 2009 16:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190867 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 16:54:00 -0000 Author: sam Date: Thu Apr 9 16:53:59 2009 New Revision: 190867 URL: http://svn.freebsd.org/changeset/base/190867 Log: check the method pointer before invoking ah_eepromDetach as it can be null if attach work fails before hooking up the eeprom support Obtained from: madwifi Modified: head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Thu Apr 9 13:02:55 2009 (r190866) +++ head/sys/dev/ath/ath_hal/ah_internal.h Thu Apr 9 16:53:59 2009 (r190867) @@ -333,8 +333,10 @@ struct ath_hal_private { #define ath_hal_disablePCIE(_ah) \ (_ah)->ah_disablePCIE(_ah) -#define ath_hal_eepromDetach(_ah) \ - AH_PRIVATE(_ah)->ah_eepromDetach(_ah) +#define ath_hal_eepromDetach(_ah) do { \ + if (AH_PRIVATE(_ah)->ah_eepromDetach != AH_NULL) \ + AH_PRIVATE(_ah)->ah_eepromDetach(_ah); \ +} while (0) #define ath_hal_eepromGet(_ah, _param, _val) \ AH_PRIVATE(_ah)->ah_eepromGet(_ah, _param, _val) #define ath_hal_eepromSet(_ah, _param, _val) \