From cda1b14c90069f9a5b67a18a0fcdb5328afe50c0 Mon Sep 17 00:00:00 2001
From: David Disseldorp <ddiss@suse.de>
Date: Tue, 6 Oct 2015 14:09:16 +0200
Subject: [PATCH] target/rbd: fix PR info memory leaks
Patch-mainline: Not yet, SES2 clustered LIO/RBD
References: bnc#948831
In handling check_conflict and read_reservation hooks, portions (or in
the case of the latter, all) of the pr_info structure may be leaked.
Signed-off-by: David Disseldorp <ddiss@suse.de>
---
drivers/target/target_core_rbd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/target/target_core_rbd.c
+++ b/drivers/target/target_core_rbd.c
@@ -1750,6 +1750,7 @@ tcm_rbd_execute_pr_read_reservation(stru
}
out:
+ tcm_rbd_pr_info_free(pr_info);
return TCM_NO_SENSE;
}
@@ -2944,7 +2945,7 @@ tcm_rbd_execute_pr_check_conflict(struct
ret = TCM_NO_SENSE;
out_info_free:
- kfree(pr_info);
+ tcm_rbd_pr_info_free(pr_info);
return ret;
}