Skip to content
Commit 18eb74fa authored by Rusty Russell's avatar Rusty Russell
Browse files

params: cleanup sysfs allocation



commit 63662139 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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 6da0b565
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment