diff options
author | Md Haris Iqbal <[email protected]> | 2022-02-17 04:09:28 +0100 |
---|---|---|
committer | Jason Gunthorpe <[email protected]> | 2022-02-18 11:59:33 -0400 |
commit | 8700af2cc18c919b2a83e74e0479038fd113c15d (patch) | |
tree | 7a815d3f387c0c0f6d5b7795376de2187f429adc /scripts/gdb/linux/utils.py | |
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/[email protected]
Reported-by: Miaoqian Lin <[email protected]>
Signed-off-by: Md Haris Iqbal <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions