diff options
author | Md Haris Iqbal <haris.iqbal@ionos.com> | 2022-02-17 04:09:28 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2022-02-18 11:59:33 -0400 |
commit | 8700af2cc18c919b2a83e74e0479038fd113c15d (patch) | |
tree | 7a815d3f387c0c0f6d5b7795376de2187f429adc /fs/jbd2/commit.c | |
parent | 32f57cb1b2c8d6f20aefec7052b1bfeb7e3b69d4 (diff) |
RDMA/rtrs-clt: Fix possible double free in error case
Callback function rtrs_clt_dev_release() for put_device() calls kfree(clt)
to free memory. We shouldn't call kfree(clt) again, and we can't use the
clt after kfree too.
Replace device_register() with device_initialize() and device_add() so that
dev_set_name can() be used appropriately.
Move mutex_destroy() to the release function so it can be called in
the alloc_clt err path.
Fixes: eab098246625 ("RDMA/rtrs-clt: Refactor the failure cases in alloc_clt")
Link: https://lore.kernel.org/r/20220217030929.323849-1-haris.iqbal@ionos.com
Reported-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Reviewed-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'fs/jbd2/commit.c')
0 files changed, 0 insertions, 0 deletions