]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
soundwire: intel: fix NULL/ERR_PTR confusion
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Thu, 3 Sep 2020 20:47:37 +0000 (04:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:11:16 +0000 (10:11 +0100)
[ Upstream commit 06dcb4e443643db93b286f861133785ca46f5a19 ]

snd_soc_dai_get_sdw_stream() can only return the pointer to stream or
an ERR_PTR value, NULL is not a possible value.

Fixes: 09553140c8d7b ('soundwire: intel: implement get_sdw_stream() operations')
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-3-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soundwire/intel.c

index a283670659a92ccf5d49a68d0cb13a14e33a6551..10ff166977f8f547fca2d706c894d942dded2dad 100644 (file)
@@ -1011,7 +1011,7 @@ static void *intel_get_sdw_stream(struct snd_soc_dai *dai,
                dma = dai->capture_dma_data;
 
        if (!dma)
-               return NULL;
+               return ERR_PTR(-EINVAL);
 
        return dma->stream;
 }