Plug three lock leaks.

This commit is contained in:
Maxime Henrion 2004-05-22 00:44:08 +00:00
parent 2c75faf3d9
commit 27d8bee2a7
2 changed files with 6 additions and 0 deletions

View File

@ -493,6 +493,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
if (mem->am_is_bound) {
device_printf(dev, "memory already bound\n");
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}
@ -501,6 +502,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
|| offset + mem->am_size > AGP_GET_APERTURE(dev)) {
device_printf(dev, "binding memory at bad offset %#x\n",
(int) offset);
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}
@ -596,6 +598,7 @@ agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
if (!mem->am_is_bound) {
device_printf(dev, "memory is not bound\n");
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}

View File

@ -493,6 +493,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
if (mem->am_is_bound) {
device_printf(dev, "memory already bound\n");
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}
@ -501,6 +502,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
|| offset + mem->am_size > AGP_GET_APERTURE(dev)) {
device_printf(dev, "binding memory at bad offset %#x\n",
(int) offset);
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}
@ -596,6 +598,7 @@ agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
if (!mem->am_is_bound) {
device_printf(dev, "memory is not bound\n");
lockmgr(&sc->as_lock, LK_RELEASE, 0, curthread);
return EINVAL;
}