From 2b2d56306b82fc14c3c02d4077fda6b2b1e7cac0 Mon Sep 17 00:00:00 2001 From: Armando Date: Wed, 11 Dec 2024 11:41:03 +0800 Subject: [PATCH] change(lp_i2s): coverity: remove not necessary null pointer check --- components/esp_driver_i2s/lp_i2s.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/esp_driver_i2s/lp_i2s.c b/components/esp_driver_i2s/lp_i2s.c index 82284bdd46..2c46566170 100644 --- a/components/esp_driver_i2s/lp_i2s.c +++ b/components/esp_driver_i2s/lp_i2s.c @@ -116,11 +116,9 @@ esp_err_t lp_i2s_new_channel(const lp_i2s_chan_config_t *chan_cfg, lp_i2s_chan_h return ESP_OK; err0: - if (ctlr->rx_chan) { - vSemaphoreDeleteWithCaps(ctlr->rx_chan->semphr); - free(ctlr->rx_chan); - ctlr->rx_chan = NULL; - } + vSemaphoreDeleteWithCaps(ctlr->rx_chan->semphr); + free(ctlr->rx_chan); + ctlr->rx_chan = NULL; err1: /* if the controller object has no channel, find the corresponding global object and destroy it */