target-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maurizio Lombardi <mlombard@redhat.com>
To: michael.christie@oracle.com
Cc: d.bogdanov@yadro.com, target-devel@vger.kernel.org,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Subject: [PATCH V2 2/2] target: set the xcopy_wq pointer to NULL after free.
Date: Thu, 15 Feb 2024 15:39:44 +0100	[thread overview]
Message-ID: <20240215143944.847184-3-mlombard@redhat.com> (raw)
In-Reply-To: <20240215143944.847184-1-mlombard@redhat.com>

Do not leave a dangling pointer after free.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 drivers/target/target_core_xcopy.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index 4128631c9dfd..1f79da0041e3 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -491,8 +491,10 @@ int target_xcopy_setup_pt(void)
 
 void target_xcopy_release_pt(void)
 {
-	if (xcopy_wq)
+	if (xcopy_wq) {
 		destroy_workqueue(xcopy_wq);
+		xcopy_wq = NULL;
+	}
 }
 
 /*
-- 
2.39.3


  parent reply	other threads:[~2024-02-15 14:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 14:39 [PATCH V2 0/2] Fix SELinux denials against target driver Maurizio Lombardi
2024-02-15 14:39 ` [PATCH V2 1/2] target: fix selinux error when systemd-modules loads the target module Maurizio Lombardi
2024-02-15 16:44   ` michael.christie
2024-02-15 17:07     ` Maurizio Lombardi
2024-02-15 21:06       ` Mike Christie
2024-02-15 14:39 ` Maurizio Lombardi [this message]
2024-02-15 16:42   ` [PATCH V2 2/2] target: set the xcopy_wq pointer to NULL after free michael.christie
2024-02-15 17:08     ` Maurizio Lombardi
2024-04-06  1:58 ` (subset) [PATCH V2 0/2] Fix SELinux denials against target driver Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240215143944.847184-3-mlombard@redhat.com \
    --to=mlombard@redhat.com \
    --cc=d.bogdanov@yadro.com \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).