linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] avoid double-free upon "old buggy kernel" sysfs_read failure
@ 2012-02-21 11:37 Jim Meyering
  2012-02-21 13:02 ` Jim Meyering
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Meyering @ 2012-02-21 11:37 UTC (permalink / raw)
  To: linux-raid


* Incremental.c (Incremental): On sysfs_read failure, don't call
sysfs_free(sra) just before "goto out_unlock", since that very
same "sra" is freed the same way by the clean-up code below.
---
FYI, coverity spotted the double free.

 Incremental.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/Incremental.c b/Incremental.c
index 78c9712..4ab9747 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -326,7 +326,6 @@ int Incremental(char *devname, int verbose, int runstop,
 			fprintf(stderr, Name
 		      ": You have an old buggy kernel which cannot support\n"
 				"      --incremental reliably.  Aborting.\n");
-			sysfs_free(sra);
 			rv = 2;
 			goto out_unlock;
 		}
--
1.7.9.1.266.g24ee9

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-21 20:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21 11:37 [PATCH] avoid double-free upon "old buggy kernel" sysfs_read failure Jim Meyering
2012-02-21 13:02 ` Jim Meyering
2012-02-21 20:14   ` NeilBrown

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).