From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 16:35:22 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]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A38DA495; Thu, 25 Jul 2013 16:35:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7100722DB; Thu, 25 Jul 2013 16:35:22 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3EF3EB926; Thu, 25 Jul 2013 12:35:21 -0400 (EDT) From: John Baldwin To: Alexander Motin Subject: Re: svn commit: r253644 - head/sys/dev/ata/chipsets Date: Thu, 25 Jul 2013 12:14:28 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201307250912.r6P9CkVE054015@svn.freebsd.org> In-Reply-To: <201307250912.r6P9CkVE054015@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201307251214.29191.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 25 Jul 2013 12:35:21 -0400 (EDT) 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: Thu, 25 Jul 2013 16:35:22 -0000 On Thursday, July 25, 2013 5:12:46 am Alexander Motin wrote: > Author: mav > Date: Thu Jul 25 09:12:46 2013 > New Revision: 253644 > URL: http://svnweb.freebsd.org/changeset/base/253644 > > Log: > Add missing NULL check after malloc(M_NOWAIT). > > Submitted by: Dmitry Luhtionov > > Modified: > head/sys/dev/ata/chipsets/ata-promise.c > > Modified: head/sys/dev/ata/chipsets/ata-promise.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 08:41:22 2013 (r253643) > +++ head/sys/dev/ata/chipsets/ata-promise.c Thu Jul 25 09:12:46 2013 (r253644) > @@ -287,6 +287,10 @@ ata_promise_chipinit(device_t dev) > /* setup host packet controls */ > hpkt = malloc(sizeof(struct ata_promise_sx4), > M_ATAPCI, M_NOWAIT | M_ZERO); > + if (hpkt == NULL) { > + device_printf(dev, "Cannot allocate HPKT\n"); > + goto failnfree; > + } > mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); > TAILQ_INIT(&hpkt->queue); > hpkt->busy = 0; Why not use M_WAITOK here? -- John Baldwin