]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
Currently in oprofilefs, files that use ulong_fops mis-handle writes of
authorMike Waychison <mikew@google.com>
Wed, 24 Aug 2011 23:47:38 +0000 (09:47 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 5 Sep 2011 07:02:31 +0000 (17:02 +1000)
commitffb7bcf641c66a3f20a4ce06691e6369394c3f45
treecb2ebb1e4f98234be15c7a7a85ef00965febb658
parent5b14f90be7511662b558f3b240a1d06393f4aa59
Currently in oprofilefs, files that use ulong_fops mis-handle writes of
zero length.  A count of 0 causes oprofilefs_ulong_from_user to return 0
(success), which then leads to oprofile_set_ulong being called to stuff
"value" into file->private_data without it being initialized.

Fix this by moving the check for a zero-length write up into
ulong_write_file.

Signed-off-by: Mike Waychison <mikew@google.com>
Cc: Robert Richter <robert.richter@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/oprofile/oprofilefs.c