Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3413259rwa; Tue, 23 Aug 2022 04:29:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR6M2VBbViWVdv5f36kR7t9NXI/yppN7nXATgJD0vKoIeWbOzrPANp/tjTnIl1LJEF47hWVr X-Received: by 2002:a17:902:e945:b0:16a:1c41:f66 with SMTP id b5-20020a170902e94500b0016a1c410f66mr23656594pll.129.1661254169097; Tue, 23 Aug 2022 04:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254169; cv=none; d=google.com; s=arc-20160816; b=XPiQnkAP6jdf3GEuduvtTqLjsDGFO1db2cRwhm2sAnFavjSf1SqWZVUT9ATOSaP6Sv 0asZ7ZqguUsO0A2kx0VAcY1PN3nbt2n487vhT+K90x4gjBZ3KROZLfHyCn7LjnijWNqc ozgUqPv1zfmynqhwTZz24kxChcw56hIXluzIT3IvX4mwgdI4vhBNfGxUrTXU6XYEvoce Tb7DjO3V0W3r/0MGwo516RLsrUoW1RWGUVHLrkS+twMxpL/8+z5CZ967oL5VUdai3a+C mVJImYpmYN0zUn252VPmsoanQoyc7tQ72u0VtL0bkxgZNfhllBW8xMCc5ZY9/ToVslyU KOYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J1T072H/YGXwEvaHw0+LXDVJoMwEuIFEXp68sjDHaAE=; b=gvxLPgi8rj11Ngz90SnEur8qZ96m5WERUv+gKYeB2qypfAbin1Rgs3lzgruYl3rkRm QbMd7D4lhAL0dYhfg6RLRqFwOei30k6+SxnScc7Dk7O1SFhkMJuvVzz4nDM30gBr8jF3 QGitGy5Cjl5shxYynFXVHPWxMmhESH7F1CHwLEgLQJwRoBOSfOB66Xh7xVTuuA+hiX0D Vy15vyZKmkyt6MemDV/8l6+QVAYwJZph289opivd9/ypeh6XdHIVzRUo7ILlgI3Ggptz LMR8YaYmHxIClMAdHn6r/5wLCvsSa9CWH7/C/vF8nq3temsFeC9m2ZHF0V9OS6YTXtkO mBKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j0uWNVLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 66-20020a630245000000b0042a59edc53bsi808009pgc.688.2022.08.23.04.29.18; Tue, 23 Aug 2022 04:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j0uWNVLB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355923AbiHWKpp (ORCPT + 99 others); Tue, 23 Aug 2022 06:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355308AbiHWKiJ (ORCPT ); Tue, 23 Aug 2022 06:38:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4FA0A6C7D; Tue, 23 Aug 2022 02:07:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id 37852B81C85; Tue, 23 Aug 2022 09:07:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8313BC433D6; Tue, 23 Aug 2022 09:07:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245657; bh=gAP38tcAj7LlaKrsijqfJ1GSUGU8jMf8tiBpQP4uIZ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j0uWNVLBLjlAAzwZ1tXynTuWQv0ih2b3HQPEzpY9jX75pT6d+cSeoYu9ns8sLngL1 NuK+B+TXs5fJjJ81BF5ftM0l24hKjR9FvFD53G3lq4JOwfdk/vOwO5OlEQNtEpbQ4C Swng1G3HwUoB2MXtNgv3v9hSl5lQhtns5ob0aiPQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , Mark Brown , Sasha Levin Subject: [PATCH 4.19 148/287] ASoC: codecs: da7210: add check for i2c_add_driver Date: Tue, 23 Aug 2022 10:25:17 +0200 Message-Id: <20220823080105.554865945@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiasheng Jiang [ Upstream commit 82fa8f581a954ddeec1602bed9f8b4a09d100e6e ] As i2c_add_driver could return error if fails, it should be better to check the return value. However, if the CONFIG_I2C and CONFIG_SPI_MASTER are both true, the return value of i2c_add_driver will be covered by spi_register_driver. Therefore, it is necessary to add check and return error if fails. Fixes: aa0e25caafb7 ("ASoC: da7210: Add support for spi regmap") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220531094712.2376759-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/da7210.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c index e172913d04a4..efc5049c0796 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -1333,6 +1333,8 @@ static int __init da7210_modinit(void) int ret = 0; #if IS_ENABLED(CONFIG_I2C) ret = i2c_add_driver(&da7210_i2c_driver); + if (ret) + return ret; #endif #if defined(CONFIG_SPI_MASTER) ret = spi_register_driver(&da7210_spi_driver); -- 2.35.1