From: Anthony PERARD <anthony.perard@citrix.com>
To: qemu-devel@nongnu.org
Cc: xen-devel@lists.xenproject.org, Peter Maydell <peter.maydell@linaro.org>
Subject: [Qemu-devel] [PULL 2/4] xen-block: remove redundant assignment
Date: Thu, 28 Feb 2019 17:34:37 +0000 [thread overview]
Message-ID: <20190228173439.8013-3-anthony.perard@citrix.com> (raw)
In-Reply-To: <20190228173439.8013-1-anthony.perard@citrix.com>
From: Paul Durrant <paul.durrant@citrix.com>
The assignment to 'p' is unnecessary as the code will either goto 'invalid'
or p will get overwritten.
Spotted by Coverity: CID 1398638
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190215162533.19475-3-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
hw/block/xen-block.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 5012af9cb6..29afe2703a 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -413,8 +413,7 @@ static void xen_block_set_vdev(Object *obj, Visitor *v, const char *name,
}
if (*end == 'p') {
- p = (char *) ++end;
- if (*end == '\0') {
+ if (*(++end) == '\0') {
goto invalid;
}
}
--
Anthony PERARD
next prev parent reply other threads:[~2019-02-28 17:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-28 17:34 [Qemu-devel] [PULL 0/4] xen queue 2019-02-28 Anthony PERARD
2019-02-28 17:34 ` [Qemu-devel] [PULL 1/4] dataplane/xen-block: remove dead code Anthony PERARD
2019-02-28 17:34 ` Anthony PERARD [this message]
2019-02-28 17:34 ` [Qemu-devel] [PULL 3/4] xen-block: report error condition from vbd_name_to_disk() Anthony PERARD
2019-02-28 17:34 ` [Qemu-devel] [PULL 4/4] xen-block: stop leaking memory in xen_block_drive_create() Anthony PERARD
2019-03-01 11:20 ` [Qemu-devel] [PULL 0/4] xen queue 2019-02-28 Peter Maydell
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=20190228173439.8013-3-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).