From: Nivedita Singhvi <niv@us.ibm.com>
To: xen-devel@lists.sourceforge.net
Subject: [Patch xen-unstable] mem alloc handling in xlvbd_init()
Date: Thu, 17 Mar 2005 15:53:38 -0800 [thread overview]
Message-ID: <423A1882.30908@us.ibm.com> (raw)
In-Reply-To: <s239aff2.084@sinclair.provo.novell.com>
[-- Attachment #1: Type: text/plain, Size: 156 bytes --]
Minor nit: would be nice to die gracefully if we fail
to allocate memory in xlvbd_init() instead of blowing
up in xlvbd_get_vbd_info().
thanks,
Nivedita
[-- Attachment #2: p1.patch --]
[-- Type: text/plain, Size: 609 bytes --]
diff -urN linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6.11-xen-sparse.new/drivers/xen/blkfront/vbd.c
--- linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c 2005-03-14 20:18:19.000000000 -0800
+++ linux-2.6.11-xen-sparse.new/drivers/xen/blkfront/vbd.c 2005-03-17 15:03:22.000000000 -0800
@@ -548,6 +548,11 @@
}
vbd_info = kmalloc(MAX_VBDS * sizeof(vdisk_t), GFP_KERNEL);
+ if (unlikely(vbd_info == NULL)) {
+ printk("KERN_ALERT Failed to allocate memory for disk info\n");
+ nr_vbds = 0;
+ return 0;
+ }
nr_vbds = xlvbd_get_vbd_info(vbd_info);
if (nr_vbds < 0) {
next prev parent reply other threads:[~2005-03-17 23:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-17 23:27 xfrd inifinite loop reloading pages Charles Coffing
2005-03-17 23:53 ` Nivedita Singhvi [this message]
2005-03-18 0:41 ` [Patch xen-unstable] mem alloc handling in xlvbd_init() Nivedita Singhvi
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=423A1882.30908@us.ibm.com \
--to=niv@us.ibm.com \
--cc=xen-devel@lists.sourceforge.net \
/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.