Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2014 19:07:22 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261084 - head/sys/geom
Message-ID:  <201401231907.s0NJ7MQV078648@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Thu Jan 23 19:07:22 2014
New Revision: 261084
URL: http://svnweb.freebsd.org/changeset/base/261084

Log:
  malloc() with M_WAITOK doesn't return NULL.
  
  MFC after:	1 week

Modified:
  head/sys/geom/geom_ctl.c

Modified: head/sys/geom/geom_ctl.c
==============================================================================
--- head/sys/geom/geom_ctl.c	Thu Jan 23 18:09:10 2014	(r261083)
+++ head/sys/geom/geom_ctl.c	Thu Jan 23 19:07:22 2014	(r261084)
@@ -122,10 +122,7 @@ geom_alloc_copyin(struct gctl_req *req, 
 	void *ptr;
 
 	ptr = g_malloc(len, M_WAITOK);
-	if (ptr == NULL)
-		req->nerror = ENOMEM;
-	else
-		req->nerror = copyin(uaddr, ptr, len);
+	nreq->nerror = copyin(uaddr, ptr, len);
 	if (!req->nerror)
 		return (ptr);
 	if (ptr != NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401231907.s0NJ7MQV078648>