From patchwork Wed Feb 26 12:13:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 25347 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7C34C203C4 for ; Wed, 26 Feb 2014 12:14:58 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wo20sf2585052obc.0 for ; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=2MBaIZ9XP6dFldl+rGeNVD9l/SSexvC74Huyu194vjA=; b=i9O3VD31hqPBedQ6bGveWud6JQtSWdV4UnR6bcIJCS5dTKKG4HB3Es2C09iHzvdULC xBCUm+AFaP7gDMoSmgRkHzcMQyg3rpfqHY6jhLzToLg8hLE2quybHXehI8g4VWoP9AYM 29h9iezkQCB38JNmVvYs0FMGjYO7WnEtYaG4aeqt/Ow8DBPP1u+C/yIKghWhp66RruvO OkzZIzDIoHvhbiNCOkxj5A5Rl+CsK4G+vUDne60IaLhXOwt2PlWuYZQVhAC4KDk26O2m BYugHAT+nUt1B/HjZ0hwdmp0fGzHFEmJqtBBiv7DzNjBwgYU/irRzOeEl9hmLhx2xXuW UfjA== X-Gm-Message-State: ALoCoQmMTlJZtoJbuv5hE156ki9zXr8JsY21p+2+/pekazr7gEuVqPz9mjgFbaSUKXAYBEVkkx3i X-Received: by 10.43.78.135 with SMTP id zm7mr2188218icb.27.1393416897945; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.201 with SMTP id d67ls226762qgd.62.gmail; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-Received: by 10.58.59.100 with SMTP id y4mr5738590veq.4.1393416897744; Wed, 26 Feb 2014 04:14:57 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id rl1si173690vcb.74.2014.02.26.04.14.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 04:14:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id cz12so1130643veb.35 for ; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-Received: by 10.58.201.5 with SMTP id jw5mr5607226vec.6.1393416897652; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp21089vcz; Wed, 26 Feb 2014 04:14:57 -0800 (PST) X-Received: by 10.140.102.242 with SMTP id w105mr6853846qge.74.1393416896896; Wed, 26 Feb 2014 04:14:56 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id k4si385944qao.8.2014.02.26.04.14.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 04:14:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WIdMJ-0006X4-0h; Wed, 26 Feb 2014 12:13:07 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WIdMH-0006Ws-H4 for xen-devel@lists.xen.org; Wed, 26 Feb 2014 12:13:05 +0000 Received: from [85.158.137.68:20588] by server-2.bemta-3.messagelabs.com id 7F/33-06531-05ADD035; Wed, 26 Feb 2014 12:13:04 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1393416781!4343234!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28683 invoked from network); 26 Feb 2014 12:13:03 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 26 Feb 2014 12:13:03 -0000 X-IronPort-AV: E=Sophos;i="4.97,547,1389744000"; d="scan'208";a="104247654" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 26 Feb 2014 12:13:01 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 26 Feb 2014 07:13:00 -0500 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WIdMC-000398-NY; Wed, 26 Feb 2014 12:13:00 +0000 From: Ian Campbell To: Date: Wed, 26 Feb 2014 12:13:00 +0000 Message-ID: <1393416780-10912-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: ian.jackson@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH] libxl: arm: do not create /chosen/bootargs in DTB if no cmdline is specified X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Otherwise we deference a NULL pointer. I saw this while experimenting with libvirt on Xen on ARM, xl already checks that the command line is non NULL and provides "" as a default. Signed-off-by: Ian Campbell Cc: george.dunlap@citrix.com> Acked-by: Julien Grall --- This is a pretty obvious fix and would be nice to have if we are taking any more fixes for other stuff , but otherwise I think we can leave to 4.4.1 quite happily. --- tools/libxl/libxl_arm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 0a1c8c5..0cfd0cf 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -164,8 +164,10 @@ static int make_chosen_node(libxl__gc *gc, void *fdt, res = fdt_begin_node(fdt, "chosen"); if (res) return res; - res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline); - if (res) return res; + if (info->u.pv.cmdline) { + res = fdt_property_string(fdt, "bootargs", info->u.pv.cmdline); + if (res) return res; + } res = fdt_end_node(fdt); if (res) return res;