dm bufio: fix missed destroy of mutex c->lock
PATCH 1/1 dm bufio: fix missed destroy of mutex c->lock
The mutex c->lock is initialized in dm_bufio_client_create, however, it is not destroyed before free the structure of dm_bufio_client in dm_bufio_client_destroy.
--- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/dm-bufio.c +1 -0
@@ -1811,6 +1811,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);
Signature · 1 line
2.15.1
2018-01-04 22:08 GMT+08:00 Xiongwei Song <[email protected]>:
Quoted 22 lines
The mutex
c->lockis initialized indm_bufio_client_create, however, it is not destroyed before free the structure ofdm_bufio_clientindm_bufio_client_destroy.Signed-off-by Xiongwei Song <[email protected]>--- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+)drivers/md/dm-bufio.c +1
-1@@ -1811,6 +1811,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); --
Quoted 2 lines
2.15.1
Sorry for the noise. I added incorrect email address. Please ignore the message. Sorry for this again.
Yours sincerely,
Xiongwei
I already staged a similar fix, see:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.16&id=cfb0bd8b25eb90faa7cbbad9a52ad2c33102123e
Quoted 24 lines · Xiongwei Song
The mutex
c->lockis initialized indm_bufio_client_create, however, it is not destroyed before free the structure ofdm_bufio_clientindm_bufio_client_destroy.Signed-off-by Xiongwei Song <[email protected]>--- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+)drivers/md/dm-bufio.c +1
-0@@ -1811,6 +1811,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);Signature · 1 line
2.15.1
2018-01-05 1:46 GMT+08:00 Mike Snitzer <[email protected]>:
Quoted 2 lines
I already staged a similar fix, see:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.16&id=cfb0bd8b25eb90faa7cbbad9a52ad2c33102123e
Apologies for the noise.
Yours sincerely,
Xiongwei
Quoted 27 lines
Quoted 24 lines · Xiongwei Song
The mutex
c->lockis initialized indm_bufio_client_create, however, it is not destroyed before free the structure ofdm_bufio_clientindm_bufio_client_destroy.Signed-off-by Xiongwei Song <[email protected]>--- drivers/md/dm-bufio.c | 1 + 1 file changed, 1 insertion(+)drivers/md/dm-bufio.c +1
-1@@ -1811,6 +1811,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); --2.15.1