Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1865203rwb; Fri, 19 Aug 2022 10:40:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR7SFlsaVm61/2XENfmbklDzixjFo/LsRVCbV4dd0IX7oHuS5nNRcTbGWMIzkvUv9f/aw4Jm X-Received: by 2002:a17:90b:3d85:b0:1f7:6a32:3576 with SMTP id pq5-20020a17090b3d8500b001f76a323576mr14933808pjb.187.1660930816231; Fri, 19 Aug 2022 10:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930816; cv=none; d=google.com; s=arc-20160816; b=waOa5UtOGgYb1f4Tp5iqrqBsc94y+bwbbZr526GtvuTwAHu6SiieZvh7ZmKgjLNeRq UaFAPhke0dwCqPwS29u4bJmbZmuLmYrWqJyICT9kPju8H+kAQOioJnXqYq8i1dYk/trf 67A7qCkO66k1ZZppo3EFaIHGzffsOOnwUuS3ZIUpmjgv/SmpDUGLAxgpsJwIJyzhmxXJ +fhs4JejBN2uGa4OMapDiVx1qwsBKuFEVE27xLqDcZic/edkdGdyUSXboP68HO63lm7N gLfUzX90ZuelfSOYAkWXaeJtYoJ2BR//vQ4v06MTOdjY5s2/BsTh8sh0hX08PysVP2HX lX0w== 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=oSuCoaqBcCTx1MyIaF9EJfnWCExwJawhYPJFXdObVQU=; b=QDAMxoVfp4DmBiqe0V1x2hyAKr1wk93lLxMrB8DRrdEBGYCMKRAhkCohGBZ9EuuVBD fEchTA4zbDyci/DC2ihDe4NxA4ybJW/3vQPurmEn0ohtYqRDv9wlj3USNyT2mgjtuW8m QR+IetKFARzXGnRRnJu0qf7fV/dWG9BU5nX95PogK7JJvgy8ZMJ4ZDApfxWvGE4iBItT GM6xXgpfI5+D/YQOtbG68GyZbu4MvnSrIQTGcoE+8iQ7sI51GFYDzMAOZz9wQXPWfah3 cLA+mILl9aRBhKzBHV7utBJDEEUxkDl4busVs5qw3dc8QeeEpCPm1GMz50Vb/cseXywU o9hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I3WX1WrS; 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 t14-20020a63460e000000b00429a2612053si1100908pga.511.2022.08.19.10.40.05; Fri, 19 Aug 2022 10:40:16 -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=I3WX1WrS; 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 S1352975AbiHSQ3p (ORCPT + 99 others); Fri, 19 Aug 2022 12:29:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352755AbiHSQ1P (ORCPT ); Fri, 19 Aug 2022 12:27:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF868119871; Fri, 19 Aug 2022 09:04:14 -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 5DC53617F0; Fri, 19 Aug 2022 16:04:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51657C433C1; Fri, 19 Aug 2022 16:04:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925053; bh=lripwqmputUdbXJiw/DzwCfh1sOUFYLQa6BHaPB4LK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I3WX1WrSQG5OgJ7+b4qsJI+zqqlH9h92xOf7saencgk+qVNflx5KJuh/+KxiLLB1F FNj7tNoamrVL0oKCj6YekB3WC4jOWw3AckvF9JyrQFnn/7GKApUHknv3+8pRws8M7c dJsVmmE6jj7dyJYMbtsVgK2zPM2mWfDFgiPa30tg= 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.10 368/545] ASoC: codecs: da7210: add check for i2c_add_driver Date: Fri, 19 Aug 2022 17:42:18 +0200 Message-Id: <20220819153845.873746786@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 3d05c37f676e..4544ed8741b6 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