From owner-svn-src-all@FreeBSD.ORG Tue Feb 3 18:59:54 2015 Return-Path: Delivered-To: svn-src-all@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 097E8C9D; Tue, 3 Feb 2015 18:59:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 E9E8C32A; Tue, 3 Feb 2015 18:59:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t13Ixrca012519; Tue, 3 Feb 2015 18:59:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t13Ixr4E012518; Tue, 3 Feb 2015 18:59:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201502031859.t13Ixr4E012518@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 3 Feb 2015 18:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278165 - head/sys/dev/fe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Tue, 03 Feb 2015 18:59:54 -0000 Author: imp Date: Tue Feb 3 18:59:52 2015 New Revision: 278165 URL: https://svnweb.freebsd.org/changeset/base/278165 Log: Silence a coverity warning about ignoring a return value. We do, but we also know that it "can't fail" given the single-threaded nature of device enumeration. Go ahead and check it just in case, but add a comment. CID: 1009393 Sponsored by: Netflix, Inc Modified: head/sys/dev/fe/if_fe_isa.c Modified: head/sys/dev/fe/if_fe_isa.c ============================================================================== --- head/sys/dev/fe/if_fe_isa.c Tue Feb 3 18:45:43 2015 (r278164) +++ head/sys/dev/fe/if_fe_isa.c Tue Feb 3 18:59:52 2015 (r278165) @@ -133,10 +133,21 @@ static int fe_isa_attach(device_t dev) { struct fe_softc *sc = device_get_softc(dev); + int error = 0; - if (sc->port_used) - fe_alloc_port(dev, sc->port_used); - fe_alloc_irq(dev, 0); + /* + * Note: these routines aren't expected to fail since we also call + * them in the probe routine. But coverity complains, so we'll honor + * that complaint since the intention here was never to ignore them.. + */ + if (sc->port_used) { + error = fe_alloc_port(dev, sc->port_used); + if (error != 0) + return (error); + } + error = fe_alloc_irq(dev, 0); + if (error != 0) + return (error); return fe_attach(dev); }