mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 05:24:39 +01:00
dm-verity: correctly handle dm_bufio_client_create() failure
If either of the calls to dm_bufio_client_create() in verity_fec_ctr()
fails, then dm_bufio_client_destroy() is later called with an ERR_PTR()
argument. That causes a crash. Fix this.
Fixes: a739ff3f54 ("dm verity: add support for forward error correction")
Cc: stable@vger.kernel.org
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
This commit is contained in:
parent
1a257c5fd3
commit
119f4f0418
1 changed files with 2 additions and 2 deletions
|
|
@ -501,9 +501,9 @@ void verity_fec_dtr(struct dm_verity *v)
|
|||
mempool_exit(&f->output_pool);
|
||||
kmem_cache_destroy(f->cache);
|
||||
|
||||
if (f->data_bufio)
|
||||
if (!IS_ERR_OR_NULL(f->data_bufio))
|
||||
dm_bufio_client_destroy(f->data_bufio);
|
||||
if (f->bufio)
|
||||
if (!IS_ERR_OR_NULL(f->bufio))
|
||||
dm_bufio_client_destroy(f->bufio);
|
||||
|
||||
if (f->dev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue