From 76a0c0e7d2bef3e06d736c337c82971885904148 Mon Sep 17 00:00:00 2001 From: haad Date: Wed, 9 Sep 2009 22:38:49 +0000 Subject: Fix bug in kmem_alloc/kmem_free of params string. Params string was allocated with length DM_MAX_PARAMS_SIZE and released with strlen + 1 size. Disable KM_NOSLEEP allocation because we do not need them here there is nothing critical in ioctl part of dm driver. Bug reported by jak@. --- sys/dev/dm/dm_pdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/dm/dm_pdev.c') diff --git a/sys/dev/dm/dm_pdev.c b/sys/dev/dm/dm_pdev.c index 8af4aaaddf9..25ea46ffab7 100644 --- a/sys/dev/dm/dm_pdev.c +++ b/sys/dev/dm/dm_pdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: dm_pdev.c,v 1.3 2009/03/18 10:22:39 cegger Exp $ */ +/* $NetBSD: dm_pdev.c,v 1.4 2009/09/09 22:38:49 haad Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -141,7 +141,7 @@ dm_pdev_alloc(const char *name) { dm_pdev_t *dmp; - if ((dmp = kmem_zalloc(sizeof(dm_pdev_t), KM_NOSLEEP)) == NULL) + if ((dmp = kmem_zalloc(sizeof(dm_pdev_t), KM_SLEEP)) == NULL) return NULL; strlcpy(dmp->name, name, MAX_DEV_NAME); -- cgit