summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_dev.c
diff options
context:
space:
mode:
authorhaad <haad@NetBSD.org>2009-09-09 22:38:49 +0000
committerhaad <haad@NetBSD.org>2009-09-09 22:38:49 +0000
commit76a0c0e7d2bef3e06d736c337c82971885904148 (patch)
tree676fe675dafc813df0ed313394cbb0cf93c4ab93 /sys/dev/dm/dm_dev.c
parentd86fd0848ebfad3579b7b0d03132d27ba3972ad6 (diff)
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@.
Diffstat (limited to 'sys/dev/dm/dm_dev.c')
-rw-r--r--sys/dev/dm/dm_dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/dm/dm_dev.c b/sys/dev/dm/dm_dev.c
index 3c8d20721b9..6392d086b49 100644
--- a/sys/dev/dm/dm_dev.c
+++ b/sys/dev/dm/dm_dev.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_dev.c,v 1.5 2009/04/13 18:51:54 haad Exp $ */
+/* $NetBSD: dm_dev.c,v 1.6 2009/09/09 22:38:49 haad Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -304,10 +304,10 @@ dm_dev_alloc(void)
{
dm_dev_t *dmv;
- dmv = kmem_zalloc(sizeof(dm_dev_t), KM_NOSLEEP);
+ dmv = kmem_zalloc(sizeof(dm_dev_t), KM_SLEEP);
if(dmv != NULL)
- dmv->diskp = kmem_zalloc(sizeof(struct disk), KM_NOSLEEP);
+ dmv->diskp = kmem_zalloc(sizeof(struct disk), KM_SLEEP);
return dmv;
}