Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp13969111rwb; Sun, 27 Nov 2022 15:04:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf6MFTbnS5YApUqX9Rv1bgYfQDeIgcQw8LO78U0cXwPKjzjltlZ3kfYHEtGWPVK5iIqi+Tpg X-Received: by 2002:a17:906:a293:b0:7bf:c6d3:b803 with SMTP id i19-20020a170906a29300b007bfc6d3b803mr2076344ejz.116.1669590265397; Sun, 27 Nov 2022 15:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669590265; cv=none; d=google.com; s=arc-20160816; b=dx60cWwaKCDSYHG3LAsh71EFksptBl1XycBXoIvJWszZmMCLdJvRiFDhiaRhFd9oaC Qh6JAskS32Jsf7EAQgkQNfYTrvJQ5kPo9Af2mTE+zNNvMn7zF5byZwRngriE2oCBXyle kY7p9RKnAHtAJP55DBH+uN2LC6E2sORhSVpSj56TzhLYTsfAHa4hR1OF0HL1+ql0Bz3E 25jYakBsxDoFLHGM9xiLnoIEBmYc+pOJV/R7UH95D9P7ltpvVoZLvwtn/LAnJWXgQ99d 81ZZUo9miqkdFwvDKRfThsdno5R91TjppXCyKZP/gGxiXpFQtLPu7m4dOqSdULygNzeM MS8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:cc:to:subject:from:date :dkim-signature; bh=gGhS+gjWIS8ZrXKdyUu4RaesR9AwE+r1bkf2O8duDok=; b=IKzdIIoGrLSdxKsNpxNtQ9lXSmU1HCKwgfmPOheShAa22mdbLdvOWbNteKvM/0qMn3 I0fj4e7Nrt8TPMqSG+9y5lbdBL5jdKnER/CT5R4T188G5ojUnyO9J5jd9em0xqVhoVgF KA1UFgOTc4FommA3tYCseHjSh3+V+zGxesWR8KuRWt8woczYf2dGAkrNo7Ut+wf6eatC PEYH75PGHpYjogaAKmOmHm4W7NxeflxSzy+mlqo1VDFYxhv0eAKNsHGXwdmNVkFHmQV0 nC77zq/kmEIRpn08RIgotTRYLvCSQHPb692CKyL/UlIpI2uku3oPupSvrF1PCFJfxKLU 7JXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=rzUG5fJ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go33-20020a1709070da100b0078e11cbb722si8304836ejc.92.2022.11.27.15.04.05; Sun, 27 Nov 2022 15:04:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=rzUG5fJ6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbiK0W24 (ORCPT + 85 others); Sun, 27 Nov 2022 17:28:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229625AbiK0W2z (ORCPT ); Sun, 27 Nov 2022 17:28:55 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C2545F5F for ; Sun, 27 Nov 2022 14:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1669588130; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=gGhS+gjWIS8ZrXKdyUu4RaesR9AwE+r1bkf2O8duDok=; b=rzUG5fJ64gHF86zW+bwbeAu50Hk4CmIIEQk1MpzDaufwF2WBmrRsudPOal4LNnKwIC6HmZ Ei4c04Xi/fTXCzvzN/RgqGYta4eaKISK6unBza3kyEDXhVm4XYb53qR8hxzIrkICNg3MGB thJGzrNqjiDG6MdsRdlLZv053EJ20hM= Date: Sun, 27 Nov 2022 22:28:41 +0000 From: Paul Cercueil Subject: of_reserved_mem_device_init() prints kernel memory in dmesg To: Marek Szyprowski , Christoph Hellwig Cc: linux-kernel , Linux Memory Management List Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, Marek, Here's what I get in dmesg on a 6.1-rc6 kernel: OF: fdt: Reserved memory: reserved region for node 'video-memory@1f00000': base 0x01f00000, size 1 MiB OF: reserved mem: initialized node video-memory@1f00000, compatible id shared-dma-pool ingenic-drm 13050000.lcd-controller: assigned reserved memory node I would *think* it's because the name is obtained using fdt_get_name() in fdt_scan_reserved_mem(), and the pointer becomes invalid as soon as the FDT is freed (is it freed?). Not sure how to fix that myself, I tried to kstrdup(uname) in fdt_reserved_mem_save_node(), but it gives me a NULL pointer, probably too early in the boot process? Cheers, -Paul