diff options
author | 2019-05-18 14:02:27 +0000 | |
---|---|---|
committer | 2019-05-18 14:02:27 +0000 | |
commit | 351babcedf0ba9db9536671df1cdbc61cb417dc5 (patch) | |
tree | 514b1ff66cdcca466fdd252eaac05e28b1ade020 /sys/dev/softraid.c | |
parent | BPF: remove redundant reference counting of filedescriptors (diff) | |
download | wireguard-openbsd-351babcedf0ba9db9536671df1cdbc61cb417dc5.tar.xz wireguard-openbsd-351babcedf0ba9db9536671df1cdbc61cb417dc5.zip |
Correct free size. Fixes a panic when detaching crypto volumes.
OK jan@, "yes please" tedu@
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 1cc442f0a6e..4f04a5572c5 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.393 2019/05/15 12:17:18 jan Exp $ */ +/* $OpenBSD: softraid.c,v 1.394 2019/05/18 14:02:27 tim Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -1954,7 +1954,8 @@ sr_ccb_free(struct sr_discipline *sd) while ((ccb = TAILQ_FIRST(&sd->sd_ccb_freeq)) != NULL) TAILQ_REMOVE(&sd->sd_ccb_freeq, ccb, ccb_link); - free(sd->sd_ccb, M_DEVBUF, sizeof(*sd->sd_ccb)); + free(sd->sd_ccb, M_DEVBUF, sd->sd_max_wu * sd->sd_max_ccb_per_wu * + sizeof(struct sr_ccb)); } struct sr_ccb * |