]> git.hungrycats.org Git - linux/commit
bcache: fix memory corruption in init error path
authorSlava Pestov <sp@daterainc.com>
Thu, 19 Jun 2014 22:05:59 +0000 (15:05 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:11:49 +0000 (21:11 +0100)
commit2a9e7fc4981125c865462fca25910807ebdbd99a
tree5e49e9ea3b61cfbab4247d365f81a810ff3c43ba
parentcea43f43751b1e6e9d034c629079d1836f3ca82d
bcache: fix memory corruption in init error path

commit c9a78332b42cbdcdd386a95192a716b67d1711a4 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>
drivers/md/bcache/super.c