From: Andrey Panin <pazke@orbita1.ru>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] fix sys_swapon() error handling in 2.5.2-dj6
Date: Wed, 30 Jan 2002 11:09:28 +0300 [thread overview]
Message-ID: <20020130110928.B251@pazke.ipt> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 277 bytes --]
Hi all,
error path in sys_swapon() can pass negative error code to filp_close()
which generates an oops, oneliner patch attached.
Best regards.
--
Andrey Panin | Embedded systems software engineer
pazke@orbita1.ru | PGP key: wwwkeys.eu.pgp.net
[-- Attachment #1.2: patch-swapon --]
[-- Type: text/plain, Size: 378 bytes --]
diff -urN -X /usr/dontdiff /linux.vanilla/mm/swapfile.c /linux/mm/swapfile.c
--- /linux.vanilla/mm/swapfile.c Wed Jan 30 01:07:49 2002
+++ /linux/mm/swapfile.c Tue Jan 29 21:23:46 2002
@@ -1073,7 +1073,7 @@
swap_list_unlock();
if (swap_map)
vfree(swap_map);
- if (swap_file)
+ if (swap_file && !IS_ERR(swap_file))
filp_close(swap_file, NULL);
out:
if (swap_header)
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
reply other threads:[~2002-01-30 8:07 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=20020130110928.B251@pazke.ipt \
--to=pazke@orbita1.ru \
--cc=linux-kernel@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