diff options
| author | Aliaksei Karaliou <akaraliou.dev@gmail.com> | 2017-12-23 05:27:03 -0500 |
|---|---|---|
| committer | Mike Snitzer <snitzer@redhat.com> | 2018-01-17 09:16:02 -0500 |
| commit | bde14184781bd24ee6fb0e1af8d69ca21acbd6e6 (patch) | |
| tree | 7e27ec63fc577e4efbbdbe13efbf9eb19294db20 /drivers/md/dm-bufio.c | |
| parent | 905be0a121d931132e081784930fc7d7c8d58071 (diff) | |
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 <akaraliou.dev@gmail.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-bufio.c')
| -rw-r--r-- | drivers/md/dm-bufio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index 951a6356fbec..1d130130f264 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c | |||
| @@ -1767,6 +1767,7 @@ bad_cache: | |||
| 1767 | } | 1767 | } |
| 1768 | dm_io_client_destroy(c->dm_io); | 1768 | dm_io_client_destroy(c->dm_io); |
| 1769 | bad_dm_io: | 1769 | bad_dm_io: |
| 1770 | mutex_destroy(&c->lock); | ||
| 1770 | kfree(c); | 1771 | kfree(c); |
| 1771 | bad_client: | 1772 | bad_client: |
| 1772 | return ERR_PTR(r); | 1773 | return ERR_PTR(r); |
| @@ -1811,6 +1812,7 @@ void dm_bufio_client_destroy(struct dm_bufio_client *c) | |||
| 1811 | BUG_ON(c->n_buffers[i]); | 1812 | BUG_ON(c->n_buffers[i]); |
| 1812 | 1813 | ||
| 1813 | dm_io_client_destroy(c->dm_io); | 1814 | dm_io_client_destroy(c->dm_io); |
| 1815 | mutex_destroy(&c->lock); | ||
| 1814 | kfree(c); | 1816 | kfree(c); |
| 1815 | } | 1817 | } |
| 1816 | EXPORT_SYMBOL_GPL(dm_bufio_client_destroy); | 1818 | EXPORT_SYMBOL_GPL(dm_bufio_client_destroy); |
