Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4354557pxb; Mon, 21 Feb 2022 18:54:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4R6MIT0JR/yrALaXA4rRnarl6lwpdQMxpIhfCNSrFMoMPL7+pNTAd2BuZdum4s/hOnKVp X-Received: by 2002:a62:84d3:0:b0:4e1:b5c:1dd4 with SMTP id k202-20020a6284d3000000b004e10b5c1dd4mr22706549pfd.20.1645498487745; Mon, 21 Feb 2022 18:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645498487; cv=none; d=google.com; s=arc-20160816; b=zxnp2+nGBCO/UuoS3MqUSmMIITaabv9hF8S39ZqmB3jNL5PtloBYQBniRdL2+EdNzn OB+RjyhnOY8v/+3uG20VxWsLgAQnyCaXSQ/Gh7zCkPjNJVfODvNmcsKXfbL0G0OBYcou 3i4CeZ5oSomS64KXSKeGNVmbx+RAk8BehSITo0twSFcDV9w3FWk+rZccm/g0CZ/9TSl3 pCZCLf6IMOp15MIsTKC6sDV7IuIizLp5AiYqo9FM3ckoTLhJS1FBwTrBtRV16Fdb7s5t EmBgR3QQUYCjQvTJxxtqq5wOIcWMlgDFCfQlboDJPfcb8jEKa1w1bsM3YEQbY5OFYlM1 xvZw== 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=JPPwLpfmlyWn6XXFxFm6An7H0qjOA4Kwgxb11pbbjD8=; b=m8sksW/61lHXZsmfC2ijx/Bhog5Ei3bub6L95BPZEcCv4inJdJbKZn8wbDB48hie3y /Zm2TPmIjcZvHhpO6pdU2Vl52gtgcrmPXmxITS8znC8duwR4ZhO/IlirpJpu2S69cMg/ OPY7rEXoxbG3CIXi13051dGydKT3AMYWQ3whbC0fIQGLSvjov5BmAwW/pWKtB36Fy2bU lavTHO9cUSytUeayjYJX/VN9PiJfAyF4XTsp7FKZLQJfyTAKIBqOUZUB+Lf7xiHYjdIE IktRMnKVss0yQHuE7V74OlVzMploGTHXNs4UDpJ90D+XMesuNhNCryLg0gmSAOamhdYB fU4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uN4HmNpl; 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 gx5-20020a17090b124500b001b89ffdad68si847203pjb.126.2022.02.21.18.54.32; Mon, 21 Feb 2022 18:54:47 -0800 (PST) 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=uN4HmNpl; 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 S1351432AbiBUJpU (ORCPT + 99 others); Mon, 21 Feb 2022 04:45:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351671AbiBUJhd (ORCPT ); Mon, 21 Feb 2022 04:37:33 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85BFB3A71D; Mon, 21 Feb 2022 01:16:24 -0800 (PST) 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 sin.source.kernel.org (Postfix) with ESMTPS id A1957CE0EB2; Mon, 21 Feb 2022 09:16:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C97DC36AE9; Mon, 21 Feb 2022 09:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434982; bh=3aV9bHzykKizB1J+5Ksl6TyTU0mBhVe4TvtLefKoCRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uN4HmNplKnyEkDj8ZYlooPAb5sN6z5yBP5lghcy8VegrCUdvSkMEgP7AvpgaD7Y5U 3u5aFotAAdmR84kWjPlSkEEPN2PZdfs+86UAPh68tbBv0bIj67DMbMBIM70x5fXH+N q5kgGqY9F6rsujbW0mfB2nzp+aJLS3a9wJWMQ8dY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Zapolskiy , Robert Foss , Bjorn Andersson , Wolfram Sang Subject: [PATCH 5.15 189/196] i2c: qcom-cci: dont delete an unregistered adapter Date: Mon, 21 Feb 2022 09:50:21 +0100 Message-Id: <20220221084937.266767413@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@linuxfoundation.org> User-Agent: quilt/0.66 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: Vladimir Zapolskiy commit a0d48505a1d68e27220369e2dd1e3573a2f362d2 upstream. If i2c_add_adapter() fails to add an I2C adapter found on QCOM CCI controller, on error path i2c_del_adapter() is still called. Fortunately there is a sanity check in the I2C core, so the only visible implication is a printed debug level message: i2c-core: attempting to delete unregistered adapter [Qualcomm-CCI] Nevertheless it would be reasonable to correct the probe error path. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Robert Foss Reviewed-by: Bjorn Andersson Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-qcom-cci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/i2c/busses/i2c-qcom-cci.c +++ b/drivers/i2c/busses/i2c-qcom-cci.c @@ -655,7 +655,7 @@ static int cci_probe(struct platform_dev return 0; error_i2c: - for (; i >= 0; i--) { + for (--i ; i >= 0; i--) { if (cci->master[i].cci) i2c_del_adapter(&cci->master[i].adap); }