From owner-svn-src-head@FreeBSD.ORG Wed May 1 10:47:07 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 B38C23A3; Wed, 1 May 2013 10:47:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 40A3316A6; Wed, 1 May 2013 10:47:06 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.6/8.14.6) with ESMTP id r41Al4dk019148; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.6/8.14.6/Submit) id r41Al4Xx019147; Wed, 1 May 2013 14:47:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 May 2013 14:47:04 +0400 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r250105 - head/sys/dev/hwpmc Message-ID: <20130501104704.GD15182@FreeBSD.org> References: <201304301559.r3UFxM88094038@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Davide Italiano , 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, 01 May 2013 10:47:07 -0000 On Tue, Apr 30, 2013 at 08:10:17PM +0400, Sergey Kandaurov wrote: S> On 30 April 2013 19:59, Davide Italiano wrote: S> > Author: davide S> > Date: Tue Apr 30 15:59:22 2013 S> > New Revision: 250105 S> > URL: http://svnweb.freebsd.org/changeset/base/250105 S> > S> > Log: S> > malloc(9) cannot return NULL if M_WAITOK flag is specified. S> > S> > Modified: S> > head/sys/dev/hwpmc/hwpmc_mod.c S> > head/sys/dev/hwpmc/hwpmc_soft.c S> > S> > Modified: head/sys/dev/hwpmc/hwpmc_mod.c S> > ============================================================================== S> > --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:38:31 2013 (r250104) S> > +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Apr 30 15:59:22 2013 (r250105) S> > @@ -2210,11 +2210,8 @@ pmc_allocate_pmc_descriptor(void) S> > struct pmc *pmc; S> > S> > pmc = malloc(sizeof(struct pmc), M_PMC, M_WAITOK|M_ZERO); S> > - S> > - if (pmc != NULL) { S> > - pmc->pm_owner = NULL; S> > - LIST_INIT(&pmc->pm_targets); S> > - } S> > + pmc->pm_owner = NULL; S> > + LIST_INIT(&pmc->pm_targets); S> > S> > PMCDBG(PMC,ALL,1, "allocate-pmc -> pmc=%p", pmc); S> S> It looks like zeroing pm_owner can also be omitted with M_ZERO. LIST_INIT is also an assignment of zero. -- Totus tuus, Glebius.