summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjitiphil <jitiphil@codeaurora.org>2018-11-16 14:17:27 +0530
committerjitiphil <jitiphil@codeaurora.org>2018-11-16 19:01:41 +0530
commit403164d912ecf69de5afa70d8acbf276facba8c8 (patch)
tree95f10da1cbbbe6d4cf44c5e310b73f83247015a9
parentd05aa97f348fc4e2497008cf9a36c1d2fe129a45 (diff)
qcacmn: Free buffer in ath_procfs_diag_read
A read buffer is allocated and used in ath_procfs_diag_read and it is not freed in one exit path which causes a memory leak Free read buffer in all exit paths of ath_procfs_diag_read Change-Id: I1b2446a99f53c2f9130d395dd316eb4649eb24db CRs-Fixed: 2352165
-rw-r--r--hif/src/ath_procfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hif/src/ath_procfs.c b/hif/src/ath_procfs.c
index f4c62b42a3e7..6835da343d7c 100644
--- a/hif/src/ath_procfs.c
+++ b/hif/src/ath_procfs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2016-2017, 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -99,8 +99,10 @@ static ssize_t ath_procfs_diag_read(struct file *file, char __user *buf,
}
out:
- if (rv)
+ if (rv) {
+ qdf_mem_free(read_buffer);
return -EIO;
+ }
if (copy_to_user(buf, read_buffer, count)) {
qdf_mem_free(read_buffer);