]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
soundwire: stream: fix NULL/IS_ERR confusion
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 3 Sep 2020 20:47:36 +0000 (04:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:11:16 +0000 (10:11 +0100)
[ 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 <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200903204739.31206-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soundwire/stream.c

index 6e36deb505b1e1e76013ccc83e9e93e0817be4df..610957f82b39cd10d3c6458fa60ed32016f2bce4 100644 (file)
@@ -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;
        }