From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8F19C77B61 for ; Mon, 24 Apr 2023 13:33:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232532AbjDXNdX (ORCPT ); Mon, 24 Apr 2023 09:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232381AbjDXNdC (ORCPT ); Mon, 24 Apr 2023 09:33:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1925B7A9F for ; Mon, 24 Apr 2023 06:32:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EAFB261E09 for ; Mon, 24 Apr 2023 13:32:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09F69C433EF; Mon, 24 Apr 2023 13:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1682343164; bh=LT55Mn/UfNnoYqllf3TgRjC4VCY9DWM25uqgDMO6Oh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gQeUy83gX1VGugNsLjPIMGsPM60jVe6YbqpF2o0vb8WhaZA8lhP2lTG3Y1KyaZ6f5 lVxKZEhK+jgpSJEnjlkd5XVIz214J+s6IErEuTP8r2CgoObOkXB7Yks5Bc9yz1U2fm Ti3TFKPBJGBytoJ2FhC7EHXsOXlHEfheBJKGZ2DU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Peter Ujfalusi , Mark Brown Subject: [PATCH 6.2 071/110] ASoC: SOF: ipc4-topology: Clarify bind failure caused by missing fw_module Date: Mon, 24 Apr 2023 15:17:33 +0200 Message-Id: <20230424131139.060200523@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230424131136.142490414@linuxfoundation.org> References: <20230424131136.142490414@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Peter Ujfalusi commit de6aa72b265b72bca2b1897d5000c8f0147d3157 upstream. The original patch uses a feature in lib/vsprintf.c to handle the invalid address when tring to print *_fw_module->man4_module_entry.name when the *rc_fw_module is NULL. This case is handled by check_pointer_msg() internally and turns the invalid pointer to '(efault)' for printing but it is hiding useful information about the circumstances. Change the print to emmit the name of the widget and a note on which side's fw_module is missing. Fixes: e3720f92e023 ("ASoC: SOF: avoid a NULL dereference with unsupported widgets") Reported-by: Dan Carpenter Link: https://lore.kernel.org/alsa-devel/4826f662-42f0-4a82-ba32-8bf5f8a03256@kili.mountain/ Signed-off-by: Peter Ujfalusi Rule: 'Cc: stable@vger.kernel.org' or 'commit upstream.' Link: https://lore.kernel.org/r/20230403090909.18233-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/sof/ipc4-topology.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -1687,10 +1687,12 @@ static int sof_ipc4_route_setup(struct s int ret; if (!src_fw_module || !sink_fw_module) { - /* The NULL module will print as "(efault)" */ - dev_err(sdev->dev, "source %s or sink %s widget weren't set up properly\n", - src_fw_module->man4_module_entry.name, - sink_fw_module->man4_module_entry.name); + dev_err(sdev->dev, + "cannot bind %s -> %s, no firmware module for: %s%s\n", + src_widget->widget->name, sink_widget->widget->name, + src_fw_module ? "" : " source", + sink_fw_module ? "" : " sink"); + return -ENODEV; }