Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2104536iof; Tue, 7 Jun 2022 19:54:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNCNCm9qO0ydU+4zR8w+dGijgWsk89KtXU2cCRWzaFJHT0gPFAo8VgwReRpsxm2kD4veXP X-Received: by 2002:a05:6a00:e8e:b0:4fa:a52f:59cf with SMTP id bo14-20020a056a000e8e00b004faa52f59cfmr32286087pfb.84.1654656857431; Tue, 07 Jun 2022 19:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656857; cv=none; d=google.com; s=arc-20160816; b=St/Dh8U8ArQQ1tFIP2SliUPYPdtcpF6r2sirHxiKdoxKEni+BL9bU6O9UBhnHD9S71 L0kQaVncqFZBTvBu3iGUmJJXfv4uJvIhgeAt7ppx6LJ5TPXMe8IYDzGXskQyNPJnCv9U RneOjcuty46nBVvbQ6ujftRGLUNwxPOP2BRwrtzlMSUwSNuqhJi+JOHpeg5qeldRefW0 9FQWYX4322n3onOqq9KqP1+XxTZJ8vWp9T+OHjyLV9SQ4x4/IKI6+oCqHC/28Cyp2vOT 0OfCe3DeVvmqTBTTh/UVkxUH4ap/k1DoY3zv/n/25BNmiR0yXZnBdIVXoKsm2hwBv8tz DWXQ== 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=F5dD9QlKg4hZvHvsRwNSYSnmBKMpwQQHuQTGYnAFMB0=; b=Lz3IpF6vQ1byF/4Nfi1cHBYVfjTaZcaYtv/euao5NDgr4a22t1/hRT3rtObJbByXgs 3IP/xXdOlc80kU9hm5OfhD87a6QpOD0CZocrelXUGeG/JaAZHQXmmvleT5N6hu2nvfPV uEp+AGq2KFDpWXmkQr8gYQjHwTOSzTWX6Zd/tzJCL7gP58QykIR4+65yyTu1q2Cbc2Mj 7z7EOGD8NSXDrII9o/t3ZoUehGP0PobcJasA1pEvXnpXrIrCLNLKd6RUM0QFFVF9YXIq IptcvC/YyQPhNSaCVE75Szc1tARrhrqDFz1vMKuWk4OE9l114jLtKTx9NHDOcijkGITR naIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HgJDhKOw; 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 p3-20020a170902f08300b0015f1388045csi22626569pla.156.2022.06.07.19.54.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:54:17 -0700 (PDT) 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=HgJDhKOw; 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 5ADB226B955; Tue, 7 Jun 2022 18:29:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383890AbiFGWGq (ORCPT + 99 others); Tue, 7 Jun 2022 18:06:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379863AbiFGVGb (ORCPT ); Tue, 7 Jun 2022 17:06:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33F2621228F; Tue, 7 Jun 2022 11:50:31 -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 B3485B8239B; Tue, 7 Jun 2022 18:50:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 205AAC385A2; Tue, 7 Jun 2022 18:50:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627813; bh=cnzevXgz+waa72ojOU4KwgyU+p6nulyrqLCnlw984fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HgJDhKOwT8mjef0djt+BaLNz76ovYO6By4Lovbwl6aDEXalx0BQqt/hfY1laBQvYf UEcXRYBCctPyYEQIqD0lzgpjS02gjJibGV8ZitoanBjyWkQejgd8mPJiAyC1V3jDVm WykEInfDWT6GkXm3sMdtSuCzQq4TP2XmSLJNqgw8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheyu Ma , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.18 101/879] media: i2c: dw9714: Disable the regulator when the driver fails to probe Date: Tue, 7 Jun 2022 18:53:39 +0200 Message-Id: <20220607165005.628589270@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 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=unavailable 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: Zheyu Ma [ Upstream commit 02276e18defa2fccf16413b44440277d98c2b1ea ] When the driver fails to probe, we will get the following splat: [ 59.305988] ------------[ cut here ]------------ [ 59.306417] WARNING: CPU: 2 PID: 395 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 [ 59.310345] RIP: 0010:_regulator_put+0x3ec/0x4e0 [ 59.318362] Call Trace: [ 59.318582] [ 59.318765] regulator_put+0x1f/0x30 [ 59.319058] devres_release_group+0x319/0x3d0 [ 59.319420] i2c_device_probe+0x766/0x940 Fix this by disabling the regulator in error handling. Signed-off-by: Zheyu Ma Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/dw9714.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index cd7008ad8f2f..8c5797ba57d4 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -183,6 +183,7 @@ static int dw9714_probe(struct i2c_client *client) return 0; err_cleanup: + regulator_disable(dw9714_dev->vcc); v4l2_ctrl_handler_free(&dw9714_dev->ctrls_vcm); media_entity_cleanup(&dw9714_dev->sd.entity); -- 2.35.1