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
This commit is contained in:
jitiphil 2018-11-16 14:17:27 +05:30 • committed by nshrivas
commit a3be364dfb

View file

@ -108,8 +108,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);