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:

committed by
Richard Weinberger

parent
369cca2668
commit
d312a25d47
@@ -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;
|
||||
|
Reference in New Issue
Block a user