]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Remove useless NULL check for qemu_strdup return value
authorBlue Swirl <blauwirbel@gmail.com>
Thu, 19 Aug 2010 20:24:43 +0000 (20:24 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Thu, 19 Aug 2010 20:24:43 +0000 (20:24 +0000)
Found with this Coccinelle semantic patch:
@@
expression E;
identifier ptr;
identifier fn ~= "qemu_strn?dup";
@@

-ptr = fn(E);
-if (ptr == NULL) { ... }
-
+ptr = fn(E);

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/virtio-9p-local.c

index 04f7f6f50179e278891bfbad9944494dca94c484..43c03c188fb3678f08a73981e957a30b8c8a0078 100644 (file)
@@ -426,9 +426,6 @@ static int local_rename(FsContext *ctx, const char *oldpath,
     int err;
 
     tmp = qemu_strdup(rpath(ctx, oldpath));
-    if (tmp == NULL) {
-        return -1;
-    }
 
     err = rename(tmp, rpath(ctx, newpath));
     if (err == -1) {