Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4432372pxb; Mon, 21 Feb 2022 21:26:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7cLJ9eR3BtsLnY8yRLL/hRFHUvU8f8k0GOsT0IHlpwesX44OBMVj44I7Pe2VpoZeu5YDm X-Received: by 2002:a05:6a00:1f08:b0:4c6:eb85:be8c with SMTP id be8-20020a056a001f0800b004c6eb85be8cmr22680282pfb.62.1645507605510; Mon, 21 Feb 2022 21:26:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645507605; cv=none; d=google.com; s=arc-20160816; b=bgqsCqyROGQXK1BItOLlYPx2MlYv3pXaPEli8YDZC7n8uUziRGeUIgrB+xrjrAKCJj M3ojV1E2t58F7qYNqtszRy+KAZTs9YuxzrHAq3cClOIS0CiJq8jdOhSa1bTiaOkx7KBI r+rL7kEdKAgT7VplPByEO4hOM3zLzPtsLdchpdDkvQuVv0tPntpFbPa7+daqEje9P8en On7JLf/4W6LlY/y9akTwv51dV/HBV62xhelUBBuogWvDGJTxNF0PomJJzs9SwwcMVlI4 XrZxiAPvADgtwG6pW2+UwHjayrjP54FL77+vJPywEg5hTTUB+S/IpQaBDDLI3h4RcCN1 oppw== 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=qYU/yRsB1XRE73Z/M0k0ApHwKPj+ehJOLPikoi9kivp9NIgRyhu+68L6+W3HD2cZgX 7oRgVCCNKQMWxsGGmnbC2DZPjXU574i69HZceR32KD3yGgklKUx3OCkcl6VYwMSpByNM RgTevl0a8ZFDMxuZXgcqcD/JC+oTf0zxqZsyxYZIaeiY61BquURk8rQ5JNsPbMz7cWsY SrOeZZi4TrlwG529NZ/x+z9EVB+YBrwLiDQ1CYQX2D1YulEQTNMDihSK8iCS+CTyqf23 tLcwACWdCgskJE9IWKp7iUwW5mXZPXjMXxKTRX+xkDsjH9KvtmUwFGtbMd60TlGhF7qL fDQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0V7hFNn9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x36si19916994pgk.651.2022.02.21.21.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:26:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0V7hFNn9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8F58212A97; Mon, 21 Feb 2022 20:56:40 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349231AbiBUJZE (ORCPT + 99 others); Mon, 21 Feb 2022 04:25:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:46478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348324AbiBUJO6 (ORCPT ); Mon, 21 Feb 2022 04:14:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE1CD13F9B; Mon, 21 Feb 2022 01:06:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4AE7960FB6; Mon, 21 Feb 2022 09:06:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E1B5C340F3; Mon, 21 Feb 2022 09:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434403; bh=3aV9bHzykKizB1J+5Ksl6TyTU0mBhVe4TvtLefKoCRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0V7hFNn9wnRUnszHGPBzF3VJjEoxmQlqcr9hKDA/M/+BZTDg+kEuzh210or9JuHKl Au+FXbKUeaZ14p6Yyd1UY91qng44Ne1rGnp9YTEXDsoS13UTZq28ZFhga4evTN74sm 4PF7Dxg2O5hkWmzBu5qi4+o4hsrpsats9t42FcHw= 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.10 117/121] i2c: qcom-cci: dont delete an unregistered adapter Date: Mon, 21 Feb 2022 09:50:09 +0100 Message-Id: <20220221084925.150729759@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084921.147454846@linuxfoundation.org> References: <20220221084921.147454846@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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); }