Skip to content
Commit d36f6efb authored by Harshit Mogalapalli's avatar Harshit Mogalapalli Committed by Luis Chamberlain
Browse files

module: Fix use-after-free bug in read_file_mod_stats()



Smatch warns:
	kernel/module/stats.c:394 read_file_mod_stats()
	warn: passing freed memory 'buf'

We are passing 'buf' to simple_read_from_buffer() after freeing it.

Fix this by changing the order of 'simple_read_from_buffer' and 'kfree'.

Fixes: df3e764d ("module: add debug stats to help identify memory pressure")
Signed-off-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
parent 44c026a7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment