From: Matt_Domsch@Dell.com
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] [PATCH] efivars.c spinlock fix
Date: Sun, 23 Sep 2001 20:40:59 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590698805240@msgid-missing> (raw)
David, below and posted at
http://domsch.com/linux/patches/efivars-spinlock-20010718.patch is a patch
to prevent efivars.c from holding a spinlock while allocating memory. Also
frees an allocation in the event of an error. This applies against your
latest 2.4.9 patch. Please include this in your 2.4.10 patch.
Thanks,
Matt
--
Matt Domsch
Sr. Software Engineer
Dell Linux Solutions
www.dell.com/linux
#2 Linux Server provider with 17% in the US and 14% Worldwide (IDC)!
#3 Unix provider with 18% in the US (Dataquest)!
$ more efivars-spinlock-20010718.patch
--- linux/arch/ia64/kernel/efivars.c.orig Wed Jul 18 22:09:12 2001
+++ linux/arch/ia64/kernel/efivars.c Wed Jul 18 22:13:36 2001
@@ -276,21 +276,20 @@
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
- spin_lock(&efivars_lock);
MOD_INC_USE_COUNT;
var_data = kmalloc(size, GFP_KERNEL);
if (!var_data) {
MOD_DEC_USE_COUNT;
- spin_unlock(&efivars_lock);
return -ENOMEM;
}
if (copy_from_user(var_data, buffer, size)) {
MOD_DEC_USE_COUNT;
- spin_unlock(&efivars_lock);
+ kfree(var_data);
return -EFAULT;
}
+ spin_lock(&efivars_lock);
/* Since the data ptr we've currently got is probably for
a different variable find the right variable.
reply other threads:[~2001-09-23 20:40 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=marc-linux-ia64-105590698805240@msgid-missing \
--to=matt_domsch@dell.com \
--cc=linux-ia64@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