From patchwork Wed Apr 22 02:17:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1274642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496PGl5D9zz9sSq for ; Wed, 22 Apr 2020 12:17:51 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=WzLqwVmJ; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 496PGl0nrZzDr0P for ; Wed, 22 Apr 2020 12:17:51 +1000 (AEST) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 496PGb6wNVzDqwH for ; Wed, 22 Apr 2020 12:17:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.a=rsa-sha256 header.s=201707 header.b=WzLqwVmJ; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 496PGb468Yz9sSm; Wed, 22 Apr 2020 12:17:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1587521863; bh=p0HZfWqWYNkY2PGDfivb0POvckr+VXv5wpDykxZMrtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzLqwVmJdajfunqAb0nMYdtoCf4N9t24Znb6z732QfDVz4SbnUSUB7rctoi8aAis2 elP/oB6c7df11LUzcKHLBRyNFN2V6Jd91QugSSLJBQFjSG+/Hz3UsG1l6nIs4ngjKu jjcgfWSYFrDe7q9c2FKNZ3R0ZjWUrpuCRTvvI45RTvhjIrP7m76mZn8QsuaYRiRdhX bK6swAiKs6Rcz8nMRWzZQmI+t33YqjKMkDxYJx6GmG3sJVubfmiFGGnXqzhz6ojtqt qmu8o0gbnlCUKgEeR9tPzVAEmEzVMahHwJFzCV9So4XFdzcGSkZLqJP/AzVWJp9KGT YM9KVYWwcfo0g== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Wed, 22 Apr 2020 12:17:31 +1000 Message-Id: <20200422021731.112666-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.25.3 In-Reply-To: <20200422021731.112666-1-amitay@ozlabs.org> References: <20200422021731.112666-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH 2/2] libpdbg: Add explicit check for library initialisation X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- libpdbg/device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libpdbg/device.c b/libpdbg/device.c index 219569e..80a8287 100644 --- a/libpdbg/device.c +++ b/libpdbg/device.c @@ -709,6 +709,11 @@ bool pdbg_targets_init(void *fdt) { struct pdbg_dtb *dtb; + if (pdbg_dt_root) { + pdbg_log(PDBG_ERROR, "pdbg_targets_init() must be called only once\n"); + return false; + } + dtb = pdbg_default_dtb(fdt); if (!dtb) {