From: Pierre-Louis Bossart <[email protected]>

[ Upstream commit 3471d2a192bace106e4da7bcdcdd5ebcca4267d2 ]

snd_soc_dai_get_sdw_stream() can only return -ENOTSUPP or the stream,
NULL is not a possible value.

Fixes: 4550569bd779f ('soundwire: stream: add helper to startup/shutdown 
streams')
Reported-by: Bard Liao <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
Link: 
https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
---
 drivers/soundwire/stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index 6e36deb505b1e..610957f82b39c 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -1913,7 +1913,7 @@ void sdw_shutdown_stream(void *sdw_substream)
 
        sdw_stream = snd_soc_dai_get_sdw_stream(dai, substream->stream);
 
-       if (!sdw_stream) {
+       if (IS_ERR(sdw_stream)) {
                dev_err(rtd->dev, "no stream found for DAI %s", dai->name);
                return;
        }
-- 
2.25.1



Reply via email to