params: Fix potential memory leak in add_sysfs_param()
commitfbd05c87e0b3fbf155e23bf1208ce43d749d4778
authoredrikk <edriss@hotmail.com>
Fri, 15 May 2015 01:02:41 +0000 (15 01:02 +0000)
committerToastman <toastman@galactic_core>
Thu, 17 Sep 2015 19:12:32 +0000 (18 02:12 +0700)
tree14a3e5ecb60c0707e32fb837a798538033bf080a
parentc883dc73c6bbe5b3f8192b2b76f8e3f1a9f989a9
params: Fix potential memory leak in add_sysfs_param()

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=63662139e519ce06090b2759cf4a1d291b9cc0e2&context=10&ignorews=0&dt=0

On allocation failure, it would fail to free the old attrs array which
was no longer referenced by anything (since it would free the old
module_param_attrs struct on the way out).

Comment the suspicious-looking krealloc() usage to explain why it *isn't*
actually buggy, despite looking like a classic realloc() usage bug.
release/src-rt-6.x.4708/linux/linux-2.6.36/kernel/params.c