From patchwork Wed Dec 11 15:04:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181243 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp917708och; Wed, 11 Dec 2019 07:23:37 -0800 (PST) X-Google-Smtp-Source: APXvYqydTMdytCsJ3YFdlC65wlHZYnRayvtjppPvOujQIIZesytjeNGuh2N6MDq13cspi2MmHwRV X-Received: by 2002:a9d:7483:: with SMTP id t3mr2697777otk.262.1576077738233; Wed, 11 Dec 2019 07:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077738; cv=none; d=google.com; s=arc-20160816; b=k4Yx1VRK0J9TNysDXGVBOqet07OYKrEimbZcIMmm/A+OLZ18awKobteu5oCODBgWCZ YqBEmR7AYt+3RBq90y41hONH9PoC8ia5vTF9XbqINHytIoPuZiaNfES+jL/AVIJIKsLa 2fhh5UOY42BlaL2c95srrsPFe2dGvwbc9JGHv3um8oxczr4Frv5dQ8+ppsx1Bz4YxM8U iqq2+2Q9J6gvrcH7oyDmhpx+NwVlc6yGM2l5YGXjTbJ6FJ5pfZcKBE41Wr1sfOJPjmTr AL+PUce8AQt7wbYelVW/iVhbdzAOf1XPmaQewuSl+X54JNSgGxYmMNDt4DMZuRg84nNH 41uA== 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:dkim-signature; bh=cj+9Dn3lH5PXDoM5CWqAIyxO/IFte8zE26zW/ol6oOc=; b=qtFaMaA1kjEDX03b3bCkIy22N+CqiD+SSDQppTcyoEX6qfR1gkBhiHy2/4ZEhYi53a nDeA7GRR0glUPyYiVcvs5/wEat+tm7+fCJAfpEZvlFlm0P8vRAXYM4jplVMkzT/wjxnI SvfGZKw4xOccNCHYLNYgNKCyfDLKfS4gzWh5Sixn8HEYjXK3WBcb6nLQAc8KAGaHLqAD 8mQasrocS8hX7GGgVeP6J6D2yWAAPMtaGX+ulfSUn4XaVRrz5/v4FodBqFmy7Ow5Mu6c XyZ80ZvF8xh15oT8i34BAwX6zRa8IGocs7jjNguIwEjhxf+YbSMnEP0Xnjhl3iCWpfna TORA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bEnurgXQ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 t142si1356124oih.242.2019.12.11.07.22.17; Wed, 11 Dec 2019 07:22:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bEnurgXQ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732309AbfLKPWQ (ORCPT + 14 others); Wed, 11 Dec 2019 10:22:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:52792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732285AbfLKPWM (ORCPT ); Wed, 11 Dec 2019 10:22:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6EC012073D; Wed, 11 Dec 2019 15:22:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077731; bh=4YMkOe683UOMZtkpg1G3VQoM/kKp2ul1XEn7gRyO554=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bEnurgXQsNGTRv8G7rnr2vFAAAvvti8r0ZFqCfhJwtcAbq9KwLCeDuwfV0p7rQoRH OFdyncR7iHgwIFvPz5KY8okbT0RoUA40SXqG716o5kj7AYDoRYs2q+N/X/pltuIjSI /CSYuz7WV6jfI0bFCR+gMuru8wREhrE4lXsfc7yw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Sasha Levin Subject: [PATCH 4.19 112/243] slimbus: ngd: Fix build error on x86 Date: Wed, 11 Dec 2019 16:04:34 +0100 Message-Id: <20191211150346.691630639@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit 458a445deb9c9fb13cec46fe9b179a84d2ff514f ] on non DT platforms like x86 of_match_node is set to NULL, dereferencing directly would throw an error. Fix this by doing this in two steps, get the match then the data. Reported-by: Greg KH Signed-off-by: Srinivas Kandagatla Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/slimbus/qcom-ngd-ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c index d72f8eed2e8b7..9221ba7b78637 100644 --- a/drivers/slimbus/qcom-ngd-ctrl.c +++ b/drivers/slimbus/qcom-ngd-ctrl.c @@ -1326,11 +1326,12 @@ static int of_qcom_slim_ngd_register(struct device *parent, { const struct ngd_reg_offset_data *data; struct qcom_slim_ngd *ngd; + const struct of_device_id *match; struct device_node *node; u32 id; - data = of_match_node(qcom_slim_ngd_dt_match, parent->of_node)->data; - + match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node); + data = match->data; for_each_available_child_of_node(parent->of_node, node) { if (of_property_read_u32(node, "reg", &id)) continue;