aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/vector_user.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-08-03 02:39:11 -0400
committerRichard Weinberger <richard@nod.at>2018-10-29 17:23:12 -0400
commitd312a25d477519d5d47f8ce850e80b52cf4113b0 (patch)
tree8810685daaa5632f4c8262656e6a06e8f520d08c /arch/um/drivers/vector_user.c
parent369cca266860db8222c991fced8caa42c3e5b05f (diff)
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>
Diffstat (limited to 'arch/um/drivers/vector_user.c')
-rw-r--r--arch/um/drivers/vector_user.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/um/drivers/vector_user.c b/arch/um/drivers/vector_user.c
index 4d6a78e31089..3d8cdbdb4e66 100644
--- a/arch/um/drivers/vector_user.c
+++ b/arch/um/drivers/vector_user.c
@@ -267,8 +267,7 @@ cleanup:
267 os_close_file(rxfd); 267 os_close_file(rxfd);
268 if (txfd >= 0) 268 if (txfd >= 0)
269 os_close_file(txfd); 269 os_close_file(txfd);
270 if (result != NULL) 270 kfree(result);
271 kfree(result);
272 return NULL; 271 return NULL;
273} 272}
274 273
@@ -434,8 +433,7 @@ cleanup:
434 if (fd >= 0) 433 if (fd >= 0)
435 os_close_file(fd); 434 os_close_file(fd);
436 if (result != NULL) { 435 if (result != NULL) {
437 if (result->remote_addr != NULL) 436 kfree(result->remote_addr);
438 kfree(result->remote_addr);
439 kfree(result); 437 kfree(result);
440 } 438 }
441 return NULL; 439 return NULL;