aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-08-19 20:24:39 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-08-19 20:24:39 +0000
commit8e00128d325ad108289347d091a6b054dbfa8ec2 (patch)
tree8c1d7a3d5983871f60292eba42f523fd6e95b078 /vl.c
parent760e77eab53f5d92eb0c587e04fd942a905b46af (diff)
downloadqemu-8e00128d325ad108289347d091a6b054dbfa8ec2.zip
qemu-8e00128d325ad108289347d091a6b054dbfa8ec2.tar.gz
qemu-8e00128d325ad108289347d091a6b054dbfa8ec2.tar.bz2
Remove useless NULL checks for qemu_malloc return value
Found with this Coccinelle semantic patch: @@ expression E; identifier ptr; identifier fn ~= "qemu_mallocz*"; @@ -ptr = fn(E); -if (ptr == NULL) { ... } - +ptr = fn(E); Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/vl.c b/vl.c
index b3e3676..ccc8d57 100644
--- a/vl.c
+++ b/vl.c
@@ -2316,12 +2316,6 @@ int main(int argc, char **argv, char **envp)
len += strlen(qemu_opt_get(opts, "security_model"));
arg_fsdev = qemu_malloc((len + 1) * sizeof(*arg_fsdev));
- if (!arg_fsdev) {
- fprintf(stderr, "No memory to parse -fsdev for %s\n",
- optarg);
- exit(1);
- }
-
sprintf(arg_fsdev, "%s,id=%s,path=%s,security_model=%s",
qemu_opt_get(opts, "fstype"),
qemu_opt_get(opts, "mount_tag"),
@@ -2332,12 +2326,6 @@ int main(int argc, char **argv, char **envp)
len += 2*strlen(qemu_opt_get(opts, "mount_tag"));
arg_9p = qemu_malloc((len + 1) * sizeof(*arg_9p));
- if (!arg_9p) {
- fprintf(stderr, "No memory to parse -device for %s\n",
- optarg);
- exit(1);
- }
-
sprintf(arg_9p, "virtio-9p-pci,fsdev=%s,mount_tag=%s",
qemu_opt_get(opts, "mount_tag"),
qemu_opt_get(opts, "mount_tag"));