diff options
author | kn <kn@cvs.openbsd.org> | 2020-07-13 00:05:40 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2020-07-13 00:05:40 +0000 |
commit | 1288d2b9d2291074e9cc32e14708144d8504971e (patch) | |
tree | f7cf316c61f95a7e6e70e273574e8e5761411ef9 /sys | |
parent | e271403d713b8cde0c2428cc39f152c52a197965 (diff) |
Fix malloc(9) size
Spotted while reading the code, we overallocate quite a bit:
(gdb) p sizeof(struct sr_meta_crypto) - sizeof(struct sr_meta_boot)
$1 = 2312
OK jsing
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/softraid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index a9d62014199..3815cca7e58 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.406 2020/07/11 13:34:05 krw Exp $ */ +/* $OpenBSD: softraid.c,v 1.407 2020/07/13 00:05:39 kn Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -3736,7 +3736,7 @@ sr_ioctl_installboot(struct sr_softc *sc, struct sr_discipline *sd, if (omi == NULL) { omi = malloc(sizeof(struct sr_meta_opt_item), M_DEVBUF, M_WAITOK | M_ZERO); - omi->omi_som = malloc(sizeof(struct sr_meta_crypto), M_DEVBUF, + omi->omi_som = malloc(sizeof(struct sr_meta_boot), M_DEVBUF, M_WAITOK | M_ZERO); omi->omi_som->som_type = SR_OPT_BOOT; omi->omi_som->som_length = sizeof(struct sr_meta_boot); |