Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1346835imm; Tue, 2 Oct 2018 06:53:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV60Uxupy3t6X7uiUfZ4vQZxdeM27RHzwgAq5eSlEj09rRMGjlETZukA5mI6HB12geMhUYBh7 X-Received: by 2002:a17:902:82c9:: with SMTP id u9-v6mr10751002plz.320.1538488427126; Tue, 02 Oct 2018 06:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538488427; cv=none; d=google.com; s=arc-20160816; b=JGcc3DABawqScDrowvv420SVqyvtfwJO/5bdAZP4lEEzF7nTwkRLb3UvgZJSW0Vvxl eND6bP5JdnFb80IKVg6WOGz6yvdGKJ7ulznqTYpC/xyeH9EcE1ZhRiXaAY9QN5N66Gon bZdMz1mxEqtIgyE84p9OPeF04nSoI0PVnt5xm2wJKOTv0fMR9UrvWew5HMDtB8ItHYnN 62HTgUIQqSZtKsVK4O3y23VaGAZb/FrUYBn01cTUZ/Tt33Tba+r3MUNv/yaSdGv70q7O IdK9KiphQ5+YES3EnPD+oOdYPwuw7JeC1od9lbRGJH5qKxaeoQ7qYVHAfe720tunAs1y sdQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=SIwaqU8i7FY/Ys3OtYWgbfr/53CHTGYyb6LGl8pc8w8=; b=xEH8xlWOc3RR4Tj1ZN8owBu7MA9btJoQZ/D3xUomgoYqrnTX8HYYck65sRZNNkvvUN 4/7L87uVRYowU5j1UwUk0TTPjDCvX2fMlWm8KtCSoJMg2OzPSGzY9PIP8TYUHWB0GmRv GftXBF57IJYJXw9dDVQ6YFzt1NOTRN8qptDaozxEoH9cAX6TdSKwb3AyzVTj+BM1wZKM EN9be2nTMPYzucrFkMTZp0ivNuK66J+VxCiyaKvaE7noYsGMd6cUlawPRn3+VjE9OZN0 dLzVlK4s//czfnmDFqkjcOFz3basd+nVzPcWQY/ZQRYEqwEpo7k3xK1uhRcKKRPF+KyW 1WFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m80-v6si14473775pfj.48.2018.10.02.06.53.32; Tue, 02 Oct 2018 06:53:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731627AbeJBUQJ (ORCPT + 99 others); Tue, 2 Oct 2018 16:16:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34718 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730647AbeJBUQJ (ORCPT ); Tue, 2 Oct 2018 16:16:09 -0400 Received: from localhost (24-104-73-23-ip-static.hfc.comcastbusiness.net [24.104.73.23]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CC05AC52; Tue, 2 Oct 2018 13:32:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Javier Martinez Canillas , Sebastian Reichel , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.14 052/137] media: omap3isp: zero-initialize the isp cam_xclk{a,b} initial data Date: Tue, 2 Oct 2018 06:24:13 -0700 Message-Id: <20181002132502.138043400@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002132458.446916963@linuxfoundation.org> References: <20181002132458.446916963@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Javier Martinez Canillas [ Upstream commit 2ec7debd44b49927a6e2861521994cc075a389ed ] The struct clk_init_data init variable is declared in the isp_xclk_init() function so is an automatic variable allocated in the stack. But it's not explicitly zero-initialized, so some init fields are left uninitialized. This causes the data structure to have undefined values that may confuse the common clock framework when the clock is registered. For example, the uninitialized .flags field could have the CLK_IS_CRITICAL bit set, causing the framework to wrongly prepare the clk on registration. This leads to the isp_xclk_prepare() callback being called, which in turn calls to the omap3isp_get() function that increments the isp dev refcount. Since this omap3isp_get() call is unexpected, this leads to an unbalanced omap3isp_get() call that prevents the requested IRQ to be later enabled, due the refcount not being 0 when the correct omap3isp_get() call happens. Fixes: 9b28ee3c9122 ("[media] omap3isp: Use the common clock framework") Signed-off-by: Javier Martinez Canillas Reviewed-by: Sebastian Reichel Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/omap3isp/isp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -305,7 +305,7 @@ static struct clk *isp_xclk_src_get(stru static int isp_xclk_init(struct isp_device *isp) { struct device_node *np = isp->dev->of_node; - struct clk_init_data init; + struct clk_init_data init = { 0 }; unsigned int i; for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i)