]> git.proxmox.com Git - mirror_qemu.git/commitdiff
xen-block: remove redundant assignment
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 15 Feb 2019 16:25:32 +0000 (16:25 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Thu, 28 Feb 2019 17:21:12 +0000 (17:21 +0000)
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

index 5012af9cb6fe71389d006321bc0b01b5101bd478..29afe2703a7dcd22f68789908f768fb8845b1f72 100644 (file)
@@ -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;
             }
         }