summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx/mlx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mlx/mlx.c')
-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