Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027308rwb; Mon, 15 Aug 2022 16:25:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6O4ui0GWBvmWAB/9/bCD/dpUHXaDK9paxXPsdbY5kWQ6PcUFE88W2Tv6bdhp4AL/qouZTU X-Received: by 2002:a17:906:9c82:b0:6df:baa2:9f75 with SMTP id fj2-20020a1709069c8200b006dfbaa29f75mr11923697ejc.762.1660605846073; Mon, 15 Aug 2022 16:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605846; cv=none; d=google.com; s=arc-20160816; b=Cl0clnbjoE3OWoe0YN/HeV/M3EGSXmvRjad2g9bTkYxVYYbLLMEaLQMS/q35JNPQ/W XWmgTMooZxLtuekmSct4jT1ddSCZQMK6atY6EjzjIwfbPcY69VoYLC4/tKwYgHYSzQwz NSrEgV12NRcj6kMe/Yw/LFu+U1vVfI8IqwYPz7ZJhG6h30tPWekStSEHgnRdJjeSjMIH CMCUpwWYwuN4bcSEb2VrlA+8lQbkUV6F1KiR3CG6tBoFYk6MB+bMHc1KRVrjaKX45A+E aV2B0ZPuH8LgMgVY2k/Wuh1k2yfvoi/Rp5Mg7pB9SIoYTKtIKzfzUHtGM22gXh5ypGuP YzQA== 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=dLfAo8k5jeNSN1MaJHyvprLoitjyqJA2K7YxhSTHihc=; b=0TaLP9z6KTI8Kxt9Pj+d9OtpYnmZ4gbHFDYi3iY+6Ubf3XuRYZcdtSqUTqvvJbaynd 7cfL1JJv48AlZrBxblnvsZRTErJzkUBPUREakZjIcsmq+qLx1CERQejeafW45Hw/5Xvi czKvSe3Yhju9UpZ3qVBGJddmFHgKn4b12wmRGd/4Ux6S0AbUhoGI+yRw+E0RcgFM8U1B qmQwJfflAr7HBzWdTrGH84ULM3nFHAx3Y9iHoREfdaICvlGQQcsew3nBqq+GD35j3vEq ic9n4JKdF3wIj4qPe1EaJIX9ltnNAimXCCY/rAOisHjfSDkTel0aAjcwey/3Y1lqiFmR S/Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jlxjx+8Y; 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 hd11-20020a170907968b00b00732f74db437si7975512ejc.891.2022.08.15.16.23.39; Mon, 15 Aug 2022 16:24:06 -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=jlxjx+8Y; 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 S1350171AbiHOWb3 (ORCPT + 99 others); Mon, 15 Aug 2022 18:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350038AbiHOW0S (ORCPT ); Mon, 15 Aug 2022 18:26:18 -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 18C0812844B; Mon, 15 Aug 2022 12:44:59 -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 41C8B61089; Mon, 15 Aug 2022 19:44:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AC9FC433D6; Mon, 15 Aug 2022 19:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592698; bh=C8wLxk7wMPsaN29ahyc7gGPIyxKfCJhjmUtAVYyWJfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jlxjx+8YGB9MUZdcL4Qjx7NUcH0mi1Zie10D+b0Mabc+KvhPrWZI9DYWvfYouvmdq 9RTzY8xPHyRaV2i15iAaf8bmqQmKBiYbypPuu1RVfejg1GH3yVaYqHSjGCXZBPtl5v H1jk/oGIsRVleRcKg+lDuRWRDsXg+bLH45Vpig/Q= 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 5.18 0832/1095] ASoC: codecs: da7210: add check for i2c_add_driver Date: Mon, 15 Aug 2022 20:03:51 +0200 Message-Id: <20220815180503.739967520@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 8af344b2fdbf..d75d15006f64 100644 --- a/sound/soc/codecs/da7210.c +++ b/sound/soc/codecs/da7210.c @@ -1336,6 +1336,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