From patchwork Tue Oct 27 13:47:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 289597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03A5AC838A2 for ; Tue, 27 Oct 2020 15:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2E6F204EF for ; Tue, 27 Oct 2020 15:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813663; bh=Yzes6xrEo+ifW018oYTyUrTqe0d4BZvBAX15R0UDcfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CYvxlTg3DJtbNiXtzbsGtVb/g4JFbE64AsREBzYA69/ZQD3NUErmGiD4SePgHDFV/ YEKGWAlGEoOzIC+AygRi0ca3aNR3k6oVaY/pgLgToECWE14IGu5Pz/ljmvFBlaZTvJ OLKZ5KL7g274gR3GG8neUKjskEz0I7NqkolQAkiA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1802217AbgJ0PqB (ORCPT ); Tue, 27 Oct 2020 11:46:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:44132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1798472AbgJ0P2Q (ORCPT ); Tue, 27 Oct 2020 11:28:16 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2685322202; Tue, 27 Oct 2020 15:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812494; bh=Yzes6xrEo+ifW018oYTyUrTqe0d4BZvBAX15R0UDcfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X7ZJkSwv+9jyiIeIw96szvpIzHM/8EyEuOPVk19xpOLffYJBAKSsww0FVo26nkhkB qLstlAQ11SbGVNi77U6yWTliFEs1luq0Vtu6gePp456jy7nG0rQxFdWnvsOMDGbBIy FkG6V5xZAh7qbESdoY+PdJRC0KVXVr2opaJsmVrA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bard Liao , Pierre-Louis Bossart , Rander Wang , Vinod Koul , Sasha Levin Subject: [PATCH 5.9 229/757] soundwire: stream: fix NULL/IS_ERR confusion Date: Tue, 27 Oct 2020 14:47:59 +0100 Message-Id: <20201027135501.350891567@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Pierre-Louis Bossart [ 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 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20200903204739.31206-2-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- 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; }