From: Aliaksei Karaliou Date: Sat, 23 Dec 2017 10:27:03 +0000 (+0300) Subject: dm bufio: add missed destroys of client mutex X-Git-Tag: v5.15~9540^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bde14184781bd24ee6fb0e1af8d69ca21acbd6e6;p=platform%2Fkernel%2Flinux-starfive.git dm bufio: add missed destroys of client mutex The client's mutex needs to be destroyed in dm_bufio_client_destroy() as well as the dm_bufio_client_create() error path. Signed-off-by: Aliaksei Karaliou Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 951a635..1d13013 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1767,6 +1767,7 @@ bad_cache: } dm_io_client_destroy(c->dm_io); bad_dm_io: + mutex_destroy(&c->lock); kfree(c); bad_client: return ERR_PTR(r); @@ -1811,6 +1812,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c) BUG_ON(c->n_buffers[i]); dm_io_client_destroy(c->dm_io); + mutex_destroy(&c->lock); kfree(c); } EXPORT_SYMBOL_GPL(dm_bufio_client_destroy);