From: Jes Sorensen <jes@trained-monkey.org>
To: linux-ia64@vger.kernel.org
Subject: [patch] sn2 kmalloc checks
Date: Fri, 17 Oct 2003 14:43:29 +0000 [thread overview]
Message-ID: <marc-linux-ia64-106640183215134@msgid-missing> (raw)
Hi David,
Here is another one fixing some missing kmalloc checks and getting rid
of an unused variable in hub_intr_s.
Relative to your 0908 2.6.0-test5
Cheers,
Jes
--- /usr/tmp/TmpDir.1480-0/linux/arch/ia64/sn/io/sn2/shub_intr.c_1.3 Fri Oct 17 07:21:12 2003
+++ linux/arch/ia64/sn/io/sn2/shub_intr.c Fri Oct 17 07:18:57 2003
@@ -1,5 +1,4 @@
-/* $Id: shub_intr.c,v 1.1 2002/02/28 17:31:25 marcelo Exp $
- *
+/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
@@ -50,7 +49,7 @@
vertex_hdl_t owner_dev,
int uncond_nothread)
{
- cpuid_t cpu = 0;
+ cpuid_t cpu;
int vector;
hub_intr_t intr_hdl;
cnodeid_t cnode;
@@ -59,13 +58,12 @@
iopaddr_t xtalk_addr;
struct xtalk_intr_s *xtalk_info;
xwidget_info_t xwidget_info;
- ilvl_t intr_swlevel = 0;
cpu = intr_heuristic(dev, dev_desc, -1, 0, owner_dev, NULL, &vector);
if (cpu = CPU_NONE) {
printk("Unable to allocate interrupt for 0x%p\n", (void *)owner_dev);
- return(0);
+ return NULL;
}
cpuphys = cpu_physical_id(cpu);
@@ -79,8 +77,13 @@
xtalk_addr = SH_II_INT0 | ((unsigned long)nasid << 36) | (1UL << 47);
}
- intr_hdl = snia_kmem_alloc_node(sizeof(struct hub_intr_s), KM_NOSLEEP, cnode);
- ASSERT_ALWAYS(intr_hdl);
+ intr_hdl = kmalloc(sizeof(struct hub_intr_s), GFP_KERNEL);
+ if (!intr_hdl) {
+ printk(KERN_ERR "do_hub_intr_alloc(): Unable to allocate "
+ "memory!\n");
+ return NULL;
+ }
+ memset(intr_hdl, 0, sizeof(struct hub_intr_s));
xtalk_info = &intr_hdl->i_xtalk_info;
xtalk_info->xi_dev = dev;
@@ -92,7 +95,6 @@
xtalk_info->xi_target = xwidget_info_masterid_get(xwidget_info);
}
- intr_hdl->i_swlevel = intr_swlevel;
intr_hdl->i_cpuid = cpu;
intr_hdl->i_bit = vector;
intr_hdl->i_flags |= HUB_INTR_IS_ALLOCED;
@@ -150,7 +152,7 @@
ASSERT(intr_hdl->i_flags & HUB_INTR_IS_ALLOCED);
- rv = intr_connect_level(cpu, vector, intr_hdl->i_swlevel, NULL);
+ rv = intr_connect_level(cpu, vector, 0, NULL);
if (rv < 0) {
return rv;
}
--- /usr/tmp/TmpDir.1480-0/linux/include/asm-ia64/sn/sn2/sn_private.h_1.4 Fri Oct 17 07:21:12 2003
+++ linux/include/asm-ia64/sn/sn2/sn_private.h Fri Oct 3 18:09:13 2003
@@ -159,7 +159,6 @@
*/
struct hub_intr_s {
struct xtalk_intr_s i_xtalk_info; /* standard crosstalk intr info */
- ilvl_t i_swlevel; /* software level for blocking intr */
cpuid_t i_cpuid; /* which cpu */
int i_bit; /* which bit */
int i_flags;
reply other threads:[~2003-10-17 14:43 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-106640183215134@msgid-missing \
--to=jes@trained-monkey.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.