From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 09:12:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C0C14687; Thu, 25 Jul 2013 09:12:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AE2B62994; Thu, 25 Jul 2013 09:12:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6P9CkwL054016; Thu, 25 Jul 2013 09:12:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6P9CkVE054015; Thu, 25 Jul 2013 09:12:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307250912.r6P9CkVE054015@svn.freebsd.org> From: Alexander Motin Date: Thu, 25 Jul 2013 09:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253644 - head/sys/dev/ata/chipsets X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 09:12:46 -0000 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;