summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2004-03-01 21:27:14 +0000
committerscottl <scottl@FreeBSD.org>2004-03-01 21:27:14 +0000
commitd3341e79a8351616fbe760d76f1edc14fbade16d (patch)
tree8f9a03c0e8524508919dcb3e1fcd0bfee59a965d /sys/dev/mlx
parentb3c23c70ff01d94f54c78cea7c0e133c16fadbfd (diff)
downloadFreeBSD-src-d3341e79a8351616fbe760d76f1edc14fbade16d.zip
FreeBSD-src-d3341e79a8351616fbe760d76f1edc14fbade16d.tar.gz
Check and free the actual pointer the was used in a malloc instead of
checking and freeing a different pointer that may or may not have been assigned the same value. This should fix panics under load that were recently reported.
Diffstat (limited to 'sys/dev/mlx')
-rw-r--r--sys/dev/mlx/mlx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/mlx/mlx.c b/sys/dev/mlx/mlx.c
index 9070af2..ea53741 100644
--- a/sys/dev/mlx/mlx.c
+++ b/sys/dev/mlx/mlx.c
@@ -1554,8 +1554,8 @@ mlx_enquire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)
if ((mc->mc_complete == NULL) && (mc != NULL))
mlx_releasecmd(mc);
/* we got an error, and we allocated a result */
- if ((error != 0) && (mc->mc_data != NULL)) {
- free(mc->mc_data, M_DEVBUF);
+ if ((error != 0) && (result != NULL)) {
+ free(result, M_DEVBUF);
mc->mc_data = NULL;
}
return(result);
OpenPOWER on IntegriCloud