From 1a15d60d0e108f971cb493986b2f75782b923d4a Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Thu, 30 May 2019 14:13:09 +0000 Subject: [PATCH] Fix busy status leak in case of incorrect passthrough args. MFC after: 1 week --- sys/dev/mpr/mpr_user.c | 6 ++++-- sys/dev/mps/mps_user.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/mpr/mpr_user.c b/sys/dev/mpr/mpr_user.c index cf9dcc6d35c..545bd25fbce 100644 --- a/sys/dev/mpr/mpr_user.c +++ b/sys/dev/mpr/mpr_user.c @@ -791,8 +791,10 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru_t *data) data->DataDirection = MPR_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mpr_dprint(sc, MPR_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__, diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c index 6a37c52970f..526bfd6c8ef 100644 --- a/sys/dev/mps/mps_user.c +++ b/sys/dev/mps/mps_user.c @@ -802,8 +802,10 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) data->DataDirection = MPS_PASS_THRU_DIRECTION_READ; else data->DataOutSize = 0; - } else - return (EINVAL); + } else { + err = EINVAL; + goto RetFreeUnlocked; + } mps_dprint(sc, MPS_USER, "%s: req 0x%jx %d rpl 0x%jx %d " "data in 0x%jx %d data out 0x%jx %d data dir %d\n", __func__,