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,8 +221,7 @@ 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);
kfree(result);
return NULL;
}
......@@ -266,8 +265,7 @@ 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);
kfree(result);
return NULL;
}
......@@ -344,10 +342,8 @@ 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);
kfree(remote_addr);
kfree(result);
return NULL;
}
......@@ -382,8 +378,7 @@ 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);
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