From patchwork Fri Nov 30 15:17:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1005992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 435ym636zdz9s9J for ; Sat, 1 Dec 2018 02:21:42 +1100 (AEDT) Received: from localhost ([::1]:33251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSkbr-0000Md-W1 for incoming@patchwork.ozlabs.org; Fri, 30 Nov 2018 10:21:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSkXr-0004c3-BG for qemu-devel@nongnu.org; Fri, 30 Nov 2018 10:17:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSkXq-0005UB-Ik for qemu-devel@nongnu.org; Fri, 30 Nov 2018 10:17:31 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:53042) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gSkXq-0005Th-9D; Fri, 30 Nov 2018 10:17:30 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gSkXd-0005QT-Lj; Fri, 30 Nov 2018 15:17:17 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 30 Nov 2018 15:17:10 +0000 Message-Id: <20181130151712.2312-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181130151712.2312-1-peter.maydell@linaro.org> References: <20181130151712.2312-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 08/10] device_tree.c: Don't use load_image() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-ppc@nongnu.org, Li Zhijian , patches@linaro.org, Peter Crosthwaite , Alexander Graf , Max Reitz , Philip Li , "Michael S. Tsirkin" , Stefan Hajnoczi , Igor Mammedov , qemu-block@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The load_image() function is deprecated, as it does not let the caller specify how large the buffer to read the file into is. Instead use load_image_size(). Signed-off-by: Peter Maydell Reviewed-by: Eric Blake --- device_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device_tree.c b/device_tree.c index 6d9c9726f66..296278e12ae 100644 --- a/device_tree.c +++ b/device_tree.c @@ -91,7 +91,7 @@ void *load_device_tree(const char *filename_path, int *sizep) /* First allocate space in qemu for device tree */ fdt = g_malloc0(dt_size); - dt_file_load_size = load_image(filename_path, fdt); + dt_file_load_size = load_image_size(filename_path, fdt, dt_size); if (dt_file_load_size < 0) { error_report("Unable to open device tree file '%s'", filename_path);