diff options
author | 2022-02-17 04:09:28 +0100 | |
---|---|---|
committer | 2022-02-18 11:59:33 -0400 | |
commit | 8700af2cc18c919b2a83e74e0479038fd113c15d (patch) | |
tree | 7a815d3f387c0c0f6d5b7795376de2187f429adc /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | IB/qib: Fix duplicate sysfs directory name (diff) | |
download | wireguard-linux-8700af2cc18c919b2a83e74e0479038fd113c15d.tar.xz wireguard-linux-8700af2cc18c919b2a83e74e0479038fd113c15d.zip |
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 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions