diff options
author | Tim van der Molen <tim@cvs.openbsd.org> | 2019-05-18 14:02:28 +0000 |
---|---|---|
committer | Tim van der Molen <tim@cvs.openbsd.org> | 2019-05-18 14:02:28 +0000 |
commit | 4fdb21a3d813d605afd9f65bbcd0dd2a4eb17e0b (patch) | |
tree | 41a8da407bd74e30723d8f489c1c3a31879f755c /sys/dev | |
parent | 7ce49ced7a1a26876f5d4d5487169c1bed082d7f (diff) |
Correct free size. Fixes a panic when detaching crypto volumes.
OK jan@, "yes please" tedu@
Diffstat (limited to 'sys/dev')
-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 * |