Date: Sat, 16 Nov 2013 10:49:02 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r258219 - stable/9/sys/dev/ata/chipsets Message-ID: <201311161049.rAGAn2ct059948@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sat Nov 16 10:49:02 2013 New Revision: 258219 URL: http://svnweb.freebsd.org/changeset/base/258219 Log: MFC r253644: Add missing NULL check after malloc(M_NOWAIT). Modified: stable/9/sys/dev/ata/chipsets/ata-promise.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-promise.c Sat Nov 16 10:47:58 2013 (r258218) +++ stable/9/sys/dev/ata/chipsets/ata-promise.c Sat Nov 16 10:49:02 2013 (r258219) @@ -288,6 +288,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311161049.rAGAn2ct059948>