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

Commit ba78c8e2 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan Committed by Dmitry Shmidt
Browse files

misc: uidstat: change release handler for stat read operation



A kmalloced object in the file opening path is not kfreed in the
closing path.

In the struct file_operations, the open operation is assigned to
single_open while release is assigned to seq_release. single_open
internally allocates memory dynamically for an object  of type
seq_operations which is subsequently not freed in the release call
to seq_release.

Fix this by calling single_release which correctly frees this
memory allocated in the open call.

Change-Id: I3ea677be301244638e3843834c46988ad999ed88
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
(cherry picked from commit 85bee652d4a19e2441bdffc34294d1e797900784)
parent 82be416c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static const struct file_operations uid_stat_read_atomic_int_fops = {
	.open		= uid_stat_read_atomic_int_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= seq_release,
	.release        = single_release,
};

/* Create a new entry for tracking the specified uid. */