From patchwork Fri Dec 15 13:40:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loys Ollivier X-Patchwork-Id: 122096 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp485528qgn; Fri, 15 Dec 2017 05:40:41 -0800 (PST) X-Google-Smtp-Source: ACJfBotZ08YKAshz99Ubh48cU/AUJnm0yOTNAKGZ71T+t7QRz90DUTflo7XyX3zjtGdwfVYseJq4 X-Received: by 10.84.129.226 with SMTP id b89mr13247108plb.258.1513345241595; Fri, 15 Dec 2017 05:40:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513345241; cv=none; d=google.com; s=arc-20160816; b=a6csycB7mH4bMrR4FReZs6h7+55xjL7+b6hpAR+jqajsa8RupedRwOozfhOgOBnNGW ypbkyk40Zzbanr9no5Du+AueGcozrWazk91Eonwh9mflne0QbBi7EbxMjqoBWtCZ3Rhw qimnN8bOcqWxs/WLtO8Lv/npnvnHuSIqhQrKS0bo1VWvIatxbr+fDmaqu5vPdIm7VvHz +rP9R1IKgWRjLyh7RGXH/mruU4BAEInQTR1I1e8hOwUQqPRyAuUMqGWwPg+h+IT5ha+Z cxUynKtqHEm3kjX8DM5KU5m65+mPukNFB60smT6NeowE876OKPn+DEl/d0/ADZ1KuKqM ln/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=d5swY86UEgSE07Ib+Il2XtCzHNqJCJr5J1RBndG0qg8=; b=YYS6TSanHNa9ZL8A1iQIFg0jCLkPd4VWLPwKTrmQ5g0heFh8flI0bFNsdQfVKx2x3o az5rj35BD3paPY2407IuTGWr8NrjRR4JYHLME8dxvIvKhwMrArwgy19Jy5RFYojPMelp gE3WZQGtV+nZ0EdZgPeEW6pFVD5XCHFePK+npYxE0Wx2apJftnkCR47Iy2x9YVB7Gr+7 3YSMdOYPaXXauXDDJVY8JCGHRFq0OY4yzWyBZ+x7LmPOb0nE2aFZvR74TApRjFKjy5Zb lZKCYyTSeIn/fHl0ZQnVBjvNqi21ay9D2dVSLG9Bwzgp7ja/Hxyrm4qDXlugjCUSoOB6 zIeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NsVPghcY; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 t69si4647149pgc.603.2017.12.15.05.40.41; Fri, 15 Dec 2017 05:40:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NsVPghcY; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756182AbdLONkk (ORCPT + 10 others); Fri, 15 Dec 2017 08:40:40 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46568 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755902AbdLONki (ORCPT ); Fri, 15 Dec 2017 08:40:38 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so17625294wme.5 for ; Fri, 15 Dec 2017 05:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=UoIeVQenElUpcUfYTzjOIMbbV7JtLcFlvDVUv5q2mBA=; b=NsVPghcYS68O7PIh08Ndcb4VH5us0P8WnudSBeBY/kZiH/CSrxjbpB8zQITTJvTWkF q9VGtsPy4gmzb3gv8viAa/ymWlISzNoSec1T3vc9FVi+sdvikErvFFuC3pqXKc7WZj/i G7Z35WjGT6sK7vEmRLq51CcuMN3MNPubVR/La4tyjtNg/WSZLCMpfy9as7oduijmWlfr 7DMlZj4DjbvXf60210CccxEaslR11J7LTvdeVkc1zldeymu160CCmxWloJjd/kBkWR+U HXCTmKkTGPTgzdN41p4qvCQDSxzY1vmDxTslfT4znFDWT+iJsc54XrO5ua3pWT2WXKMD HATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UoIeVQenElUpcUfYTzjOIMbbV7JtLcFlvDVUv5q2mBA=; b=dAEYKq6eL3R75WNFU63gWYIjieiTWBBVDsATVTy2OKzD+JwB4HTYO2xvqXbxiEqKjV X6DVMNyYFvchMNSnjQeGhdKudVbT1nZhtlRGuOsHp/0MrNoqCdqqZZDoPu82wZ1Xmb9R cf6aDxLaXQ78bWi2weBdGL+Z4Hk38AOLc6yqaZgBgRjC3qN0JSB/GYnyWV4+5P8c1m7e PeIt3KfJb2JQ3iBnwBsEbD19e36oxY02dUNXmy6safotn3cjvHHWm8r13uePwHKfMOH9 HbG9iOhikEHjIyd8EcG8RBuQtGtPC4NrJ5HyRkYb/N4AY8IuwQvN0wLarCYVbmoM7N8z OrpA== X-Gm-Message-State: AKGB3mJWCo7xenr16y5KDbJN8ma8weGiVejlf4SZmcyu/CIHDjtzbs8o ELR25nmnraV5Xj1Ljiiqe8e42Q== X-Received: by 10.28.111.146 with SMTP id c18mr5555956wmi.123.1513345237772; Fri, 15 Dec 2017 05:40:37 -0800 (PST) Received: from loys-XPS-13-9360.home (ANice-251-1-1-224.w86-203.abo.wanadoo.fr. [86.203.10.224]) by smtp.googlemail.com with ESMTPSA id t138sm11289281wme.16.2017.12.15.05.40.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 05:40:37 -0800 (PST) From: Loys Ollivier To: Andy Gross , David Brown Cc: Loys Ollivier , linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Jerome Brunet , Stephen Boyd Subject: [PATCH v3] firmware: qcom: scm: Fix incorrect of_node_put calls in scm_init Date: Fri, 15 Dec 2017 14:40:14 +0100 Message-Id: <1513345214-22835-1-git-send-email-lollivier@baylibre.com> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When using other platform architectures, in the init of the qcom_scm driver, of_node_put is called on /firmware if no qcom dt is found. This results in a kernel error: Bad of_node_put() on /firmware. These calls to of_node_put from the qcom_scm init are unnecessary as of_find_matching_node and of_platform_populate are calling it automatically. Remove the calls to of_node_put() on fw_np. Fixes: d0f6fa7ba2d6 ("firmware: qcom: scm: Convert SCM to platform driver") Suggested-by: Stephen Boyd Signed-off-by: Loys Ollivier --- drivers/firmware/qcom_scm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reported-by: Loys Ollivier Signed-off-by: Sudeep Holla diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index af4c75217ea6..f6d7b7cffe0c 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -632,17 +632,13 @@ static int __init qcom_scm_init(void) np = of_find_matching_node(fw_np, qcom_scm_dt_match); - if (!np) { - of_node_put(fw_np); + if (!np) return -ENODEV; - } of_node_put(np); ret = of_platform_populate(fw_np, qcom_scm_dt_match, NULL, NULL); - of_node_put(fw_np); - if (ret) return ret;