Message ID | 20190325215849.13182-2-tony@atomide.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9489925 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 25 Mar 2019 22:33:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFEAA29041 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 25 Mar 2019 22:33:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B38712917A; Mon, 25 Mar 2019 22:33:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5B56729041 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 25 Mar 2019 22:33:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IodbnZ9FfR8aAgOl9EMStabmRzbKeBn8Ao8zRUCuSHY=; b=M0vy9rRdRGW+w/ Wi+HMTMiFSCKe02POXK0OVllnFoWJ46R4EQh5+L90UQfuRCV4tRZNK6HLVe+5xBRXfUXftQxCzDIu 7VOt2HPa8EVcLKTTM3NAi51nA/l5n9ElZLfUHldL2eyeBRGzUX2MmrSTwLXBzb1Csw60/bYmsPDr+ R66SwfHtUk47kF8Q4eWKpPTUYPHGimn06GduGvO1f19Lu47+GVRAWSFeEf1zn1GPLMLF2Z8fsSuwr +Xjx26AtFszgPZR/TMM8S2qc3Qjj1VrLSZvlTPr457OXQTeDLR5QsHEkK/NF+lAhVvflMFAHiopql 0lAXn6ngy94oI39RKECA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Y9J-0006Qa-BG; Mon, 25 Mar 2019 22:32:57 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8Y7j-0004Cu-Vx for linux-arm-kernel@bombadil.infradead.org; Mon, 25 Mar 2019 22:31:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=YI9qkEj+rFYM7umj5PClpdVyq1EfX3s4+H1JkPwxAtc=; b=kdJemoN7pLsnMCm/DxClpTTYf9 Nh+uBAoiSu2/MZjxgVmSiJQNQvvc1fxU1vDfF9kba0EIQGKAHDsSDC8I9Xo5UB6jc1YdOsK0z3/Zt Sb4Ox9kenR95yo5zOjAc/vcYoWuloRs4ZgehaNndrmub7Vja39LBfzZcMs/6mge6+P0cZ4ksPuHcp ONmXCkN3Hyc+2zH9Y3bKCduC12PeOwH9cn7WPUJ56nXxHWIo+oGKK2wSVeg10Ob9GX4vVVf+1R3l0 Ehjo1NM6efcfeCUY49PukH6f1ybQnMoG0N+4Pit61VgWohwoptsF5DBbfWkqm5Bxz3pI1sem6X2Rc lWcFts4A==; Received: from muru.com ([72.249.23.125]) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8XcX-0000DR-0f for linux-arm-kernel@lists.infradead.org; Mon, 25 Mar 2019 21:59:07 +0000 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id B04C58120; Mon, 25 Mar 2019 21:59:12 +0000 (UTC) From: Tony Lindgren <tony@atomide.com> To: linux-omap@vger.kernel.org Subject: [PATCH 01/14] bus: ti-sysc: Fix sysc_unprepare() when no clocks have been allocated Date: Mon, 25 Mar 2019 14:58:36 -0700 Message-Id: <20190325215849.13182-2-tony@atomide.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190325215849.13182-1-tony@atomide.com> References: <20190325215849.13182-1-tony@atomide.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_175905_280494_201C5F58 X-CRM114-Status: GOOD ( 10.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Nishanth Menon <nm@ti.com>, Tero Kristo <t-kristo@ti.com>, Dave Gerlach <d-gerlach@ti.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-kernel@vger.kernel.org, Peter Ujfalusi <peter.ujfalusi@ti.com>, Faiz Abbas <faiz_abbas@ti.com>, Keerthy <j-keerthy@ti.com>, linux-arm-kernel@lists.infradead.org, Roger Quadros <rogerq@ti.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
ti-sysc changes to probe devices with dts data only
|
expand
|
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -1331,6 +1331,9 @@ static void sysc_unprepare(struct sysc *ddata) { int i; + if (!ddata->clocks) + return; + for (i = 0; i < SYSC_MAX_CLOCKS; i++) { if (!IS_ERR_OR_NULL(ddata->clocks[i])) clk_unprepare(ddata->clocks[i]);
If we return early before ddata->clocks have been allocated we will get a NULL pointer dereference in sysc_unprepare(). Let's fix this by returning early when no clocks are allocated. Fixes: 0eecc636e5a2 ("bus: ti-sysc: Add minimal TI sysc interconnect target driver") Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/bus/ti-sysc.c | 3 +++ 1 file changed, 3 insertions(+)