From owner-svn-src-head@FreeBSD.ORG Wed Apr 17 17:15:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E6EFDFB; Wed, 17 Apr 2013 17:15:13 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x22b.google.com (mail-ea0-x22b.google.com [IPv6:2a00:1450:4013:c01::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 365DA786; Wed, 17 Apr 2013 17:15:12 +0000 (UTC) Received: by mail-ea0-f171.google.com with SMTP id b15so839824eae.30 for ; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ie1J0O3M68qFRoT1eCeEZwIgDPwin/Nv8SzXLX6r+HQ=; b=ecgSWLEdWrmqiU03wR81nslHJRUs3xdHdBU2jRlhFlsMDsDNwLWbqY+xiVWiw/QIb/ /8AjaBPLRr5JYEHioAmJSyU8oDMBJkpwXfPvTxQMU/bdXGIx5/6RhPMEgd1fgVYl/jiG 8ToozNY7mkBbqaMHpOgpAkZk9EOJkGnAF3HRhsQA5RQTt2qwG9NW7FXeiVI8+c1PCHjO 3NHA2DWTA9Nr6e6Kmut3Lwf/hhe7N30QkfqUPol14blApQMlTEwsDDe1fQ1Gk/A71Siq km1rl9ie8OuJXLrdcEB5T92c3CzJ0dN6x46ng3ipBND3k+f1IWSVdM+L170iOhv2WSrB mEPQ== MIME-Version: 1.0 X-Received: by 10.14.219.8 with SMTP id l8mr20135311eep.40.1366218911331; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.15.91.72 with HTTP; Wed, 17 Apr 2013 10:15:11 -0700 (PDT) In-Reply-To: <201304161210.09058.jhb@freebsd.org> References: <201304140242.r3E2geSq094403@svn.freebsd.org> <201304161210.09058.jhb@freebsd.org> Date: Wed, 17 Apr 2013 10:15:11 -0700 X-Google-Sender-Auth: KEc0hZRjDAmECyFQvcvznp_5_Yk Message-ID: Subject: Re: svn commit: r249461 - head/sys/dev/ips From: hiren panchasara To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 17 Apr 2013 17:15:13 -0000 On Tue, Apr 16, 2013 at 9:10 AM, John Baldwin wrote: > On Saturday, April 13, 2013 10:42:40 pm Hiren Panchasara wrote: >> Author: hiren >> Date: Sun Apr 14 02:42:40 2013 >> New Revision: 249461 >> URL: http://svnweb.freebsd.org/changeset/base/249461 >> >> Log: >> Fixing a clang warning indicating uninitialized variable usage. >> >> PR: kern/177164 >> Approved by: sbruno (mentor) > > Hmm, I always thought that dmatags and maps were opaque types and not > necessarily "known" in consumers to be pointers. (Some drivers do check tehm > against NULL implicitly via 'if (map)' or 'if (tag)', but well-behaved drivers > use other means (flags, etc.) to know if they are valid.) Hi John, Would this be a better fix? We do not need to do any clean up if we fail to create the tag: Index: ips.c =================================================================== --- ips.c (revision 249588) +++ ips.c (working copy) @@ -578,7 +578,7 @@ { int error; bus_dma_tag_t dmatag; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; if (bus_dma_tag_create( /* parent */ sc->adapter_dmatag, /* alignemnt */ 1, /* boundary */ 0, @@ -595,7 +595,7 @@ &dmatag) != 0) { device_printf(sc->dev, "can't alloc dma tag for statue queue\n"); error = ENOMEM; - goto exit; + return error; } if(bus_dmamem_alloc(dmatag, (void *)&(sc->copper_queue), BUS_DMA_NOWAIT, &dmamap)){ Thanks, Hiren > > -- > John Baldwin