Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Release buffer in case a receive failed.



details:   https://anonhg.NetBSD.org/src/rev/0552421d0fe1
branches:  trunk
changeset: 751302:0552421d0fe1
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jan 31 11:39:55 2010 +0000

description:
Release buffer in case a receive failed.

diffstat:

 sys/arch/x86/x86/ipmi.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 08bb7341cea2 -r 0552421d0fe1 sys/arch/x86/x86/ipmi.c
--- a/sys/arch/x86/x86/ipmi.c   Sun Jan 31 11:29:31 2010 +0000
+++ b/sys/arch/x86/x86/ipmi.c   Sun Jan 31 11:39:55 2010 +0000
@@ -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)



Home | Main Index | Thread Index | Old Index