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

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 <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Rander Wang <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
---
 drivers/soundwire/intel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index 710f5eba936b..7c20b7daf1c8 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -1142,7 +1142,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;
 }
-- 
2.17.1

Reply via email to