From patchwork Thu Apr 2 19:18:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 228211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33B0DC2BA12 for ; Thu, 2 Apr 2020 19:18:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06ABD206F8 for ; Thu, 2 Apr 2020 19:18:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kCykBnSZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726963AbgDBTSV (ORCPT ); Thu, 2 Apr 2020 15:18:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38514 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389486AbgDBTSV (ORCPT ); Thu, 2 Apr 2020 15:18:21 -0400 Received: by mail-wm1-f67.google.com with SMTP id f6so4957990wmj.3 for ; Thu, 02 Apr 2020 12:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=5ViWoK06xQspHTq5fSoOq1VehibGSMcOWc3+p1ggF7w=; b=kCykBnSZeXynX7WMhKEUNnXlNINAJ0Z1S0422jqmxF4a+kR8umpE1acde+/vlKQaOu Hu0cPs+MiWRSvZuhDp0MBPRCfvx/rEcAn5C46kkdDm+D7Ge9YLCpgGy6ihvcg6viykbK z6E11P2ooN6NA5R4HCLqyn0kECzVuabhqRWaHzemfrs8Mo1ZZEeAgxz56NWlb/YeOLFV jworYSczGA9cIqbdGS1YFggoKE7g+91yPTGCvGTMYgS9WGCSBqmwt0Ef9NKLURdC7yMh nQlwCWEqHpLbM/vIdMjdTQzzQwIM3JjfGGsp2Sac69mjU/Bkzr5O3189D64Ir0jHia09 z8+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ViWoK06xQspHTq5fSoOq1VehibGSMcOWc3+p1ggF7w=; b=r0iNzggTNlUpo5xPlFpyUgS+s4zvWe1/PZP5KZhyiaQvFxOWAoT4gaUuEHqmg9Uw1h tO2HCc2TBvqYwc2KqwRxDJWatOs2fM+gya/tVXS0Kqc0pi3PpsUTAxG9xj19IcUFJ0iN wvx288FGcR8Yg0fujcw9c/WQ9zxcjtEu+vyqVIWK3P1g+98jzGLzVeGuI71nI5ctrEfL q8GNu8e9jxAN65xuHq/uqgEeW9nYaLm4LDmCxGRXnNjR8EhdSnthRoVZ7mWaKMDxIonr nCFVxWI85t4dGHZ3FQOanRrV+3g/6rs3Z2j0ChIuzzM8LjwYDj1pl0a5/ta3ENbZn0ai r6WQ== X-Gm-Message-State: AGi0PuZgxGsQa7RXQHAEIp3eU/yvCKeCXexbZs21AxOCwrz9WOMa5TPB VQgNLEkTd/28y0vq0Xhbpa/haLa5idK86w== X-Google-Smtp-Source: APiQypLmPW/Wk8HfoYIq6bi0s5OFg4HBU14ISJnrvM6+ByLpGiic4/uawsHE7K3mqZo6UHaDpuzPtw== X-Received: by 2002:a05:600c:2197:: with SMTP id e23mr4810369wme.90.1585855099042; Thu, 02 Apr 2020 12:18:19 -0700 (PDT) Received: from localhost.localdomain ([95.149.164.95]) by smtp.gmail.com with ESMTPSA id l10sm8622707wrq.95.2020.04.02.12.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2020 12:18:18 -0700 (PDT) From: Lee Jones To: stable@vger.kernel.org Subject: [PATCH 4.4 17/20] of: fix missing kobject init for !SYSFS && OF_DYNAMIC config Date: Thu, 2 Apr 2020 20:18:53 +0100 Message-Id: <20200402191856.789622-17-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200402191856.789622-1-lee.jones@linaro.org> References: <20200402191856.789622-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Rob Herring [ Upstream commit bd82bbf38cbe27f2c65660da801900d71bcc5cc8 ] The ref counting is broken for OF_DYNAMIC when sysfs is disabled because the kobject initialization is skipped. Only the properties add/remove/update should be skipped for !SYSFS config. Tested-by: Nicolas Pitre Reviewed-by: Frank Rowand Acked-by: Grant Likely Signed-off-by: Rob Herring Signed-off-by: Lee Jones --- drivers/of/base.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 27783223ca5cd..8adffecd710b8 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -167,9 +167,6 @@ int __of_attach_node_sysfs(struct device_node *np) struct property *pp; int rc; - if (!IS_ENABLED(CONFIG_SYSFS)) - return 0; - if (!of_kset) return 0;