From: Jeremy Higdon <jeremy@sgi.com>
To: linux-ide@vger.kernel.org
Cc: jrn@sgi.com, maule@sgi.com
Subject: [PATCH 2.6.15-rc5 1/1] sgiioc4: check for no hwifs available
Date: Tue, 13 Dec 2005 17:17:28 -0800 [thread overview]
Message-ID: <20051214011728.GA184713@sgi.com> (raw)
Add a check to the sgiioc4 driver for the case where all available
ide_hwifs structures are in use.
Signed-off-by: Jeremy Higdon <jeremy@sgi.com>
--- linux-2.6.15-rc5/drivers/ide/pci/sgiioc4.c 2005-12-03 21:10:42.000000000 -0800
+++ linux-2.6.15-rc5-new/drivers/ide/pci/sgiioc4.c 2005-12-13 01:03:52.000000000 -0800
@@ -622,12 +622,18 @@
ide_hwif_t *hwif;
int h;
+ /*
+ * Find an empty HWIF; if none available, return -ENOMEM.
+ */
for (h = 0; h < MAX_HWIFS; ++h) {
hwif = &ide_hwifs[h];
- /* Find an empty HWIF */
if (hwif->chipset == ide_unknown)
break;
}
+ if (h == MAX_HWIFS) {
+ printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", d->name);
+ return -ENOMEM;
+ }
/* Get the CmdBlk and CtrlBlk Base Registers */
base = pci_resource_start(dev, 0) + IOC4_CMD_OFFSET;
next reply other threads:[~2005-12-14 1:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-14 1:17 Jeremy Higdon [this message]
2005-12-14 21:12 ` [PATCH 2.6.15-rc5 1/1] sgiioc4: check for no hwifs available Bartlomiej Zolnierkiewicz
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=20051214011728.GA184713@sgi.com \
--to=jeremy@sgi.com \
--cc=jrn@sgi.com \
--cc=linux-ide@vger.kernel.org \
--cc=maule@sgi.com \
/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).