All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, jgross@suse.com,
	Bertrand.Marquis@arm.com, julien@xen.org,
	Volodymyr_Babchuk@epam.com,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: [PATCH v4 1/9] xen/dt: dt_property_read_string should return -ENODATA on !length
Date: Thu, 31 Mar 2022 17:38:39 -0700	[thread overview]
Message-ID: <20220401003847.38393-1-sstabellini@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2203311735380.2910984@ubuntu-linux-20-04-desktop>

From: Stefano Stabellini <stefano.stabellini@xilinx.com>

When the length is zero (pp->length == 0), dt_property_read_string
should return -ENODATA, but actually currently returns -EILSEQ because
there is no specific check for lenght == 0.

Add a check now.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 xen/common/device_tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 4aae281e89..db67fb5fb4 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -198,7 +198,7 @@ int dt_property_read_string(const struct dt_device_node *np,
 
     if ( !pp )
         return -EINVAL;
-    if ( !pp->value )
+    if ( !pp->value || !pp->length )
         return -ENODATA;
     if ( strnlen(pp->value, pp->length) >= pp->length )
         return -EILSEQ;
-- 
2.25.1



  reply	other threads:[~2022-04-01  0:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01  0:38 [PATCH v4 0/9] dom0less PV drivers Stefano Stabellini
2022-04-01  0:38 ` Stefano Stabellini [this message]
2022-04-01  8:05   ` [PATCH v4 1/9] xen/dt: dt_property_read_string should return -ENODATA on !length Henry Wang
2022-04-01  0:38 ` [PATCH v4 2/9] xen/arm: implement domU extended regions Stefano Stabellini
2022-04-01 13:52   ` Luca Fancellu
2022-04-01 14:34   ` Julien Grall
2022-04-01  0:38 ` [PATCH v4 3/9] xen/arm: temporarily elevate idle_domain privileged during create_domUs Stefano Stabellini
2022-04-01 17:36   ` Julien Grall
2022-04-01  0:38 ` [PATCH v4 4/9] xen: export evtchn_alloc_unbound Stefano Stabellini
2022-04-05  9:50   ` Jan Beulich
2022-04-01  0:38 ` [PATCH v4 5/9] xen: introduce xen,enhanced dom0less property Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 6/9] xen/arm: configure dom0less domain for enabling xenstore after boot Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 7/9] xenstored: send an evtchn notification on introduce_domain Stefano Stabellini
2022-04-01 12:48   ` Juergen Gross
2022-04-01  0:38 ` [PATCH v4 8/9] tools: add example application to initialize dom0less PV drivers Stefano Stabellini
2022-04-01 10:21   ` Julien Grall
2022-04-01 10:46     ` Juergen Gross
2022-04-01 13:35       ` Julien Grall
2022-04-01 13:52         ` Juergen Gross
2022-04-01 14:04           ` Julien Grall
2022-04-01 14:11             ` Juergen Gross
2022-04-06  2:21       ` Stefano Stabellini
2022-04-06  8:58         ` Julien Grall
2022-04-13  1:22           ` Stefano Stabellini
2022-04-01  0:38 ` [PATCH v4 9/9] docs: document dom0less + " Stefano Stabellini
2022-04-01 10:48   ` Luca Fancellu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220401003847.38393-1-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.