Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 403164d9 authored by jitiphil's avatar jitiphil
Browse files

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
parent d05aa97f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
/*
 * 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);