Module Name: src Committed By: pooka Date: Tue Apr 21 10:54:52 UTC 2015
Modified Files: src/sys/kern: kern_kthread.c kern_physio.c vfs_trans.c Log Message: Don't check if constant-sized KM_SLEEP allocations succeeded. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/kern/kern_kthread.c cvs rdiff -u -r1.92 -r1.93 src/sys/kern/kern_physio.c cvs rdiff -u -r1.31 -r1.32 src/sys/kern/vfs_trans.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_kthread.c diff -u src/sys/kern/kern_kthread.c:1.39 src/sys/kern/kern_kthread.c:1.40 --- src/sys/kern/kern_kthread.c:1.39 Sat Sep 1 00:26:37 2012 +++ src/sys/kern/kern_kthread.c Tue Apr 21 10:54:52 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_kthread.c,v 1.39 2012/09/01 00:26:37 matt Exp $ */ +/* $NetBSD: kern_kthread.c,v 1.40 2015/04/21 10:54:52 pooka Exp $ */ /*- * Copyright (c) 1998, 1999, 2007, 2009 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.39 2012/09/01 00:26:37 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_kthread.c,v 1.40 2015/04/21 10:54:52 pooka Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -89,10 +89,6 @@ kthread_create(pri_t pri, int flag, stru } if (fmt != NULL) { l->l_name = kmem_alloc(MAXCOMLEN, KM_SLEEP); - if (l->l_name == NULL) { - kthread_destroy(l); - return ENOMEM; - } va_start(ap, fmt); vsnprintf(l->l_name, MAXCOMLEN, fmt, ap); va_end(ap); Index: src/sys/kern/kern_physio.c diff -u src/sys/kern/kern_physio.c:1.92 src/sys/kern/kern_physio.c:1.93 --- src/sys/kern/kern_physio.c:1.92 Thu Feb 10 14:46:45 2011 +++ src/sys/kern/kern_physio.c Tue Apr 21 10:54:52 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_physio.c,v 1.92 2011/02/10 14:46:45 pooka Exp $ */ +/* $NetBSD: kern_physio.c,v 1.93 2015/04/21 10:54:52 pooka Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993 @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.92 2011/02/10 14:46:45 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_physio.c,v 1.93 2015/04/21 10:54:52 pooka Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -231,8 +231,7 @@ physio(void (*strategy)(struct buf *), s flags &= B_READ | B_WRITE; - if ((ps = kmem_zalloc(sizeof(*ps), KM_SLEEP)) == NULL) - return ENOMEM; + ps = kmem_zalloc(sizeof(*ps), KM_SLEEP); /* ps->ps_running = 0; */ /* ps->ps_error = 0; */ /* ps->ps_failed = 0; */ Index: src/sys/kern/vfs_trans.c diff -u src/sys/kern/vfs_trans.c:1.31 src/sys/kern/vfs_trans.c:1.32 --- src/sys/kern/vfs_trans.c:1.31 Fri Sep 5 05:57:21 2014 +++ src/sys/kern/vfs_trans.c Tue Apr 21 10:54:52 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_trans.c,v 1.31 2014/09/05 05:57:21 matt Exp $ */ +/* $NetBSD: vfs_trans.c,v 1.32 2015/04/21 10:54:52 pooka Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.31 2014/09/05 05:57:21 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_trans.c,v 1.32 2015/04/21 10:54:52 pooka Exp $"); /* * File system transaction operations. @@ -165,8 +165,7 @@ fstrans_mount(struct mount *mp) error = vfs_busy(mp, NULL); if (error) return error; - if ((newfmi = kmem_alloc(sizeof(*newfmi), KM_SLEEP)) == NULL) - return ENOMEM; + newfmi = kmem_alloc(sizeof(*newfmi), KM_SLEEP); newfmi->fmi_state = FSTRANS_NORMAL; newfmi->fmi_ref_cnt = 1; LIST_INIT(&newfmi->fmi_cow_handler); @@ -604,8 +603,7 @@ fscow_establish(struct mount *mp, int (* fmi = mp->mnt_transinfo; KASSERT(fmi != NULL); - if ((newch = kmem_alloc(sizeof(*newch), KM_SLEEP)) == NULL) - return ENOMEM; + newch = kmem_alloc(sizeof(*newch), KM_SLEEP); newch->ch_func = func; newch->ch_arg = arg;