From e0b1bb6c5f1d333a746135f0323889e02b61480c Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 20 Jun 2017 11:33:03 -0600 Subject: [PATCH] 802.15.4 MAC: Fix some errors in the previous commit. --- wireless/ieee802154/mac802154_data.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wireless/ieee802154/mac802154_data.c b/wireless/ieee802154/mac802154_data.c index b51d31880f..bd06e58b16 100644 --- a/wireless/ieee802154/mac802154_data.c +++ b/wireless/ieee802154/mac802154_data.c @@ -147,10 +147,10 @@ int mac802154_req_data(MACHANDLE mac, ret = mac802154_takesem(&priv->exclsem, true); if (ret < 0) { - /* Should only fail it interrupted by a signal */ + /* Should only fail if interrupted by a signal */ wlwarn("WARNING: mac802154_takesem failed: %d", ret); - goto errout_with_sem; + return ret; } /* If both destination and source addressing information is present, the MAC @@ -235,8 +235,12 @@ int mac802154_req_data(MACHANDLE mac, ret = mac802154_txdesc_alloc(priv, &txdesc, true); if (ret < 0) { + /* Should only fail if interrupted by a signal while re-acquiring + * exclsem. So the lock is not held if a failure is returned. + */ + wlwarn("WARNING: mac802154_txdesc_alloc failed: %d", ret); - goto errout_with_sem; + return ret; } txdesc->conf->handle = meta->msdu_handle; @@ -301,7 +305,6 @@ int mac802154_req_data(MACHANDLE mac, } else { - mac802154_givesem(&priv->exclsem); ret = -EINVAL; goto errout_with_sem; }