Commit 4a7c4624 authored by Alex Dewar's avatar Alex Dewar Committed by Richard Weinberger

um: Remove some unnecessary NULL checks in vector_user.c

kfree() already checks for null pointers, so additional checking is
unnecessary.
Signed-off-by: default avatarAlex Dewar <alex.dewar@gmx.co.uk>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 237ce2e6
......@@ -221,7 +221,6 @@ static struct vector_fds *user_init_tap_fds(struct arglist *ifspec)
return result;
tap_cleanup:
printk(UM_KERN_ERR "user_init_tap: init failed, error %d", fd);
if (result != NULL)
kfree(result);
return NULL;
}
......@@ -266,7 +265,6 @@ static struct vector_fds *user_init_hybrid_fds(struct arglist *ifspec)
return result;
hybrid_cleanup:
printk(UM_KERN_ERR "user_init_hybrid: init failed");
if (result != NULL)
kfree(result);
return NULL;
}
......@@ -344,9 +342,7 @@ static struct vector_fds *user_init_unix_fds(struct arglist *ifspec, int id)
unix_cleanup:
if (fd >= 0)
os_close_file(fd);
if (remote_addr != NULL)
kfree(remote_addr);
if (result != NULL)
kfree(result);
return NULL;
}
......@@ -382,7 +378,6 @@ static struct vector_fds *user_init_raw_fds(struct arglist *ifspec)
return result;
raw_cleanup:
printk(UM_KERN_ERR "user_init_raw: init failed, error %d", err);
if (result != NULL)
kfree(result);
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment