From: Matthew Wilcox <willy@debian.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix file_lock_cache leak
Date: Fri, 27 Sep 2002 15:17:41 +0100 [thread overview]
Message-ID: <20020927151741.D27592@parcelfarce.linux.theplanet.co.uk> (raw)
Always free the request, not just on error.
diff -urpNX dontdiff linux-2.5.38/fs/locks.c linux-2.5.38-flock/fs/locks.c
--- linux-2.5.38/fs/locks.c 2002-09-21 18:47:00.000000000 -0700
+++ linux-2.5.38-flock/fs/locks.c 2002-09-26 10:36:16.000000000 -0700
@@ -1459,10 +1470,8 @@ int fcntl_setlk(struct file *filp, unsig
break;
}
-out:
- if (error) {
- locks_free_lock(file_lock);
- }
+ out:
+ locks_free_lock(file_lock);
return error;
}
@@ -1601,11 +1614,8 @@ int fcntl_setlk64(struct file *filp, uns
break;
}
-
out:
- if (error) {
- locks_free_lock(file_lock);
- }
+ locks_free_lock(file_lock);
return error;
}
#endif /* BITS_PER_LONG == 32 */
--
Revolutions do not require corporate support.
reply other threads:[~2002-09-27 14:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020927151741.D27592@parcelfarce.linux.theplanet.co.uk \
--to=willy@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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;
as well as URLs for NNTP newsgroup(s).