From: NeilBrown <neilb@suse.de>
To: dm-devel@redhat.com
Subject: [PATCH libdmraid-events 1/3] Add some missing closedir calls.
Date: Fri, 11 Dec 2009 14:22:56 +1100 [thread overview]
Message-ID: <20091211032402.781887148@suse.de> (raw)
In-Reply-To: 20091211032255.766079509@suse.de
[-- Attachment #1: closedir-fixes --]
[-- Type: text/plain, Size: 990 bytes --]
Two times opendir is called without a matching
closedir - so add those calls.
Signed-off-by: NeilBrown <neilb@suse.de>
---
libdmraid-events.c | 2 ++
1 file changed, 2 insertions(+)
--- libdmraid-events.orig/libdmraid-events.c
+++ libdmraid-events/libdmraid-events.c
@@ -172,6 +172,7 @@ static int _repopulate(const char* devic
memcpy(test_path+strlen(sys_path), strchr(disk+1, '/')+1, strlen(strchr(disk+1, '/')+1));
if((dir = opendir(test_path)))
{
+ closedir(dir);
/* test path is for this raid volume */
memcpy(test_path+strlen(test_path), "/dev", 4);
if(!(fd = fopen(test_path, "r"))) {
@@ -959,6 +960,7 @@ int register_device(const char *device,
if(!(dir = opendir(test_path)))
continue;
else {
+ closedir(dir);
/* test path is for this raid volume */
memcpy(rv_next->raid_mem[m].dev_name, scsi_dev, strlen(scsi_dev));
memset(rv_next->raid_mem[m].dev_name+strlen(scsi_dev), 0, 1);
next prev parent reply other threads:[~2009-12-11 3:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 3:22 [PATCH libdmraid-events 0/3] Assorted fixes NeilBrown
2009-12-11 3:22 ` NeilBrown [this message]
2009-12-11 3:22 ` [PATCH libdmraid-events 2/3] Fix some issues with use of snprintf NeilBrown
2009-12-11 3:22 ` [PATCH libdmraid-events 3/3] Fix minor memory leak in lib_main NeilBrown
2009-12-14 14:28 ` [PATCH libdmraid-events 0/3] Assorted fixes Heinz Mauelshagen
2009-12-15 0:43 ` Neil Brown
2009-12-15 1:07 ` Neil Brown
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=20091211032402.781887148@suse.de \
--to=neilb@suse.de \
--cc=dm-devel@redhat.com \
/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