Module Name:    src
Committed By:   mlelstv
Date:           Sun Jan 31 11:39:55 UTC 2010

Modified Files:
        src/sys/arch/x86/x86: ipmi.c

Log Message:
Release buffer in case a receive failed.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/x86/ipmi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.41 src/sys/arch/x86/x86/ipmi.c:1.42
--- src/sys/arch/x86/x86/ipmi.c:1.41	Mon Oct 19 18:41:10 2009
+++ src/sys/arch/x86/x86/ipmi.c	Sun Jan 31 11:39:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.41 2009/10/19 18:41:10 bouyer Exp $ */
+/*	$NetBSD: ipmi.c,v 1.42 2010/01/31 11:39:55 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.41 2009/10/19 18:41:10 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.42 2010/01/31 11:39:55 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1032,7 +1032,7 @@
 		    txlen, data, &txlen);
 
 	if (buf == NULL) {
-		printf("ipmi: sendcmd malloc fails\n");
+		printf("ipmi: sendcmd buffer busy\n");
 		goto done;
 	}
 	rc = sc->sc_if->sendmsg(sc, txlen, buf);
@@ -1079,8 +1079,10 @@
 		return (-1);
 	}
 	/* Receive message from interface, copy out result data */
-	if (sc->sc_if->recvmsg(sc, maxlen + 3, &rawlen, buf))
+	if (sc->sc_if->recvmsg(sc, maxlen + 3, &rawlen, buf)) {
+		ipmi_buf_release(sc, buf);
 		return (-1);
+	}
 
 	*rxlen = rawlen - IPMI_MSG_DATARCV;
 	if (*rxlen > 0 && data)

Reply via email to