From: Ralf Baechle <ralf@linux-mips.org>
To: Willy Tarreau <w@1wt.eu>
Cc: Frank Seidel <Frank.Seidel@sphairon.com>,
linux-mips@linux-mips.org, netdev@vger.kernel.org
Subject: [PATCH] linux-2.4: br2684: allocation out of atomic context
Date: Mon, 29 Jun 2009 16:49:05 +0100 [thread overview]
Message-ID: <20090629154905.GD18570@linux-mips.org> (raw)
From: Arne Redlich <redlicha@sphairon.com>
Moved GFP_Kernel allocation out of atomic context
Signed-off-by: Arne Redlich <redlicha@sphairon.com>
Signed-off-by: Frank Seidel <Frank.Seidel@sphairon.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
net/atm/br2684.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -509,6 +509,10 @@ Note: we do not have explicit unassign,
MOD_DEC_USE_COUNT;
return -EFAULT;
}
+ brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
+ if (!brvcc)
+ return -ENOMEM;
+ memset(brvcc, 0, sizeof(struct br2684_vcc));
write_lock_irq(&devs_lock);
brdev = br2684_find_dev(&be.ifspec);
if (brdev == NULL) {
@@ -532,11 +536,6 @@ Note: we do not have explicit unassign,
err = -EINVAL;
goto error;
}
- brvcc = kmalloc(sizeof(struct br2684_vcc), GFP_KERNEL);
- if (!brvcc) {
- err = -ENOMEM;
- goto error;
- }
memset(brvcc, 0, sizeof(struct br2684_vcc));
DPRINTK("br2684_regvcc vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps,
brvcc);
@@ -567,6 +566,7 @@ Note: we do not have explicit unassign,
return 0;
error:
write_unlock_irq(&devs_lock);
+ kfree(brvcc);
MOD_DEC_USE_COUNT;
return err;
}
reply other threads:[~2009-06-29 15:49 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=20090629154905.GD18570@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=Frank.Seidel@sphairon.com \
--cc=linux-mips@linux-mips.org \
--cc=netdev@vger.kernel.org \
--cc=w@1wt.eu \
/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).