From owner-svn-src-all@FreeBSD.ORG Sat Jun 13 07:37:54 2015 Return-Path: Delivered-To: svn-src-all@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26F2F51F; Sat, 13 Jun 2015 07:37:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EA92900; Sat, 13 Jun 2015 07:37:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t5D7bktP039161 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 13 Jun 2015 10:37:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t5D7bktP039161 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id t5D7bkmP039160; Sat, 13 Jun 2015 10:37:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 13 Jun 2015 10:37:46 +0300 From: Konstantin Belousov To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r284336 - head/sys/dev/acpi_support Message-ID: <20150613073746.GJ2080@kib.kiev.ua> References: <201506130555.t5D5tQij003839@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201506130555.t5D5tQij003839@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 13 Jun 2015 07:37:54 -0000 On Sat, Jun 13, 2015 at 05:55:26AM +0000, Allan Jude wrote: > Author: allanjude (doc committer) > Date: Sat Jun 13 05:55:26 2015 > New Revision: 284336 > URL: https://svnweb.freebsd.org/changeset/base/284336 > > Log: > acpi_ibm.ko panics if SMBIOS information is not available > > Add a check for NULL before strcmp on smbios information incase it is not populated > > Differential Revision: https://reviews.freebsd.org/D2750 > Reviewed by: ngie, jhb > Approved by: rpaulo > Sponsored by: ScaleEngine Inc. > > Modified: > head/sys/dev/acpi_support/acpi_ibm.c > > Modified: head/sys/dev/acpi_support/acpi_ibm.c > ============================================================================== > --- head/sys/dev/acpi_support/acpi_ibm.c Sat Jun 13 01:28:19 2015 (r284335) > +++ head/sys/dev/acpi_support/acpi_ibm.c Sat Jun 13 05:55:26 2015 (r284336) > @@ -485,6 +485,9 @@ acpi_ibm_attach(device_t dev) > /* Enable per-model events. */ > maker = kern_getenv("smbios.system.maker"); > product = kern_getenv("smbios.system.product"); > + if (maker != NULL && product != NULL) > + goto nosmbios; This looks reversed. I would expect the condition to be if (maker == NULL || product == NULL) goto ...; > + > for (i = 0; i < nitems(acpi_ibm_models); i++) { > if (strcmp(maker, acpi_ibm_models[i].maker) == 0 && > strcmp(product, acpi_ibm_models[i].product) == 0) { > @@ -494,6 +497,8 @@ acpi_ibm_attach(device_t dev) > ACPI_SERIAL_END(ibm); > } > } > + > +nosmbios: > freeenv(maker); > freeenv(product); >