bcache: fix memory corruption in init error path

commit c9a78332b4 upstream.

If register_cache_set() failed, we would touch ca->set after
it had already been freed. Also, fix an assertion to catch
this.

Change-Id: I748e5f5b223e2d9b2602075dec2f997cced2394d
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Slava Pestov 2014-06-19 15:05:59 -07:00 • committed by Ben Hutchings
commit 2a9e7fc498