um: NULL check before kfree is not needed

kfree(NULL) is safe,so this removes NULL check before freeing the mem

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
YueHaibing
2018-08-03 14:39:11 +08:00
committed by Richard Weinberger
parent 369cca2668
commit d312a25d47
3 changed files with 8 additions and 16 deletions

View File

@@ -267,8 +267,7 @@ cleanup:
os_close_file(rxfd);
if (txfd >= 0)
os_close_file(txfd);
if (result != NULL)
kfree(result);
kfree(result);
return NULL;
}
@@ -434,8 +433,7 @@ cleanup:
if (fd >= 0)
os_close_file(fd);
if (result != NULL) {
if (result->remote_addr != NULL)
kfree(result->remote_addr);
kfree(result->remote_addr);
kfree(result);
}
return NULL;