params: cleanup sysfs allocation
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 9 Nov 2014 23:02:29 +0000 (09:32 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 11 Nov 2014 06:37:47 +0000 (17:07 +1030)
commit18eb74fa94161380c1acc9cf562cb835c4e54a25
tree33434c7ac01b5dc7b9a8fc7cd4a02981fe2de93a
parent6da0b565150b32318757062bc75834113f0508d6
params: cleanup sysfs allocation

commit 63662139e519ce06090b2759cf4a1d291b9cc0e2 attempted to patch a
leak (which would only happen on OOM, ie. never), but it didn't quite
work.

This rewrites the code to be as simple as possible.  add_sysfs_param()
adds a parameter.  If it fails, it's the caller's responsibility to
clean up the parameters which already exist.

The kzalloc-then-always-krealloc pattern is perhaps overly simplistic,
but this code has clearly confused people.  It worked on me...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
kernel/params.c
This page took 0.02767 seconds and 5 git commands to generate.