From a28087e72aa53c8af44a855a18ff95f53c921549 Mon Sep 17 00:00:00 2001 From: Christopher Pascoe Date: Thu, 29 Mar 2007 07:40:11 +0000 Subject: Avoid leaking a ccb in error paths. --- sys/dev/pci/ahci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/dev') diff --git a/sys/dev/pci/ahci.c b/sys/dev/pci/ahci.c index 692e4a06350..fdf049ef4c0 100644 --- a/sys/dev/pci/ahci.c +++ b/sys/dev/pci/ahci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ahci.c,v 1.104 2007/03/29 02:35:41 pascoe Exp $ */ +/* $OpenBSD: ahci.c,v 1.105 2007/03/29 07:40:10 pascoe Exp $ */ /* * Copyright (c) 2006 David Gwynne @@ -1843,6 +1843,9 @@ ahci_put_err_ccb(struct ahci_ccb *ccb) printf("ahci_port_err_ccb_restore but SACT %08x != 0?\n", sact); KASSERT(ahci_pread(ap, AHCI_PREG_CI) == 0); + /* Done with the CCB */ + ahci_put_ccb(ccb); + /* Restore outstanding command state */ ap->ap_sactive = ap->ap_err_saved_sactive; ap->ap_active_cnt = ap->ap_err_saved_active_cnt; -- cgit v1.2.3