summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/scvtb.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2001-07-14 03:26:02 +0000
committernyan <nyan@FreeBSD.org>2001-07-14 03:26:02 +0000
commit81a72cd354d04ca32ff2c2965440c3972df1491d (patch)
tree8091ccd98c5363d54b9b839880b18a5f39e4f4cc /sys/pc98/cbus/scvtb.c
parent09dcbc22712dc77539172247e56e1da19e596034 (diff)
downloadFreeBSD-src-81a72cd354d04ca32ff2c2965440c3972df1491d.zip
FreeBSD-src-81a72cd354d04ca32ff2c2965440c3972df1491d.tar.gz
Merged from the following changes.
sys/dev/syscons/scvgarndr.c revision 1.11 sys/dev/syscons/scvtb.c revision 1.8 sys/dev/syscons/syscons.c revisions 1.361, 1.363, 1.364, 1.365 and 1.366 sys/isa/atkbd_isa.c revision 1.9 sys/isa/syscons_isa.c revision 1.17
Diffstat (limited to 'sys/pc98/cbus/scvtb.c')
-rw-r--r--sys/pc98/cbus/scvtb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/pc98/cbus/scvtb.c b/sys/pc98/cbus/scvtb.c
index d068f0e..1543587 100644
--- a/sys/pc98/cbus/scvtb.c
+++ b/sys/pc98/cbus/scvtb.c
@@ -110,6 +110,7 @@ sc_vtb_init(sc_vtb_t *vtb, int type, int cols, int rows, void *buf, int wait)
if (vtb->vtb_buffer != NULL) {
bzero((void *)sc_vtb_pointer(vtb, 0),
cols*rows*sizeof(u_int16_t)*2);
+ vtb->vtb_flags |= VTB_ALLOCED;
}
} else {
vtb->vtb_buffer = (vm_offset_t)buf;
@@ -130,7 +131,6 @@ sc_vtb_destroy(sc_vtb_t *vtb)
{
vm_offset_t p;
- vtb->vtb_flags = 0;
vtb->vtb_cols = 0;
vtb->vtb_rows = 0;
vtb->vtb_size = 0;
@@ -141,12 +141,13 @@ sc_vtb_destroy(sc_vtb_t *vtb)
switch (vtb->vtb_type) {
case VTB_MEMORY:
case VTB_RINGBUFFER:
- if (p != NULL)
+ if ((vtb->vtb_flags & VTB_ALLOCED) && (p != NULL))
free((void *)p, M_DEVBUF);
break;
default:
break;
}
+ vtb->vtb_flags = 0;
vtb->vtb_type = VTB_INVALID;
}
OpenPOWER on IntegriCloud