From: Hannes Reinecke <hare@suse.de>
To: "Randy.Dunlap" <rdunlap@xenotime.net>, linux-ide@vger.kernel.org
Subject: [PATCH] libata crashes on incorrectly initialised ports
Date: Mon, 13 Mar 2006 10:14:56 +0100 [thread overview]
Message-ID: <44153810.10702@suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
Hi all,
Randy found an interesting usage of the label 'err_out' in
libata-core.c:ata_device_add().
'err_out' is meant to be called to teardown existing sysfs entries.
As such is it clearly wrong to call it if the sysfs registration fails.
Please apply.
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux Products GmbH S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: libata-host-add-failure --]
[-- Type: text/plain, Size: 1229 bytes --]
From: Hannes Reinecke <hare@suse.de>
Subject: libata crashes on incorrectly initialized ports
Randy Dunlap noted:
With the update ahci I am getting these messages (typed by
me, no serial port for console), but ata2 drive is not present (!?):
ata2: could not start DMA engine
BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
plus a Call Trace like so (names only transcribed here):
class_device_del
class_device_unregister
scsi_remove_host
ata_host_remove
ata_device_add
ahci_init_one
... normal pci driver init/register functions ...
The label 'err_out' is used twice; the first usage of which is wrong
as there is not host registered in sysfs which we could deregister.
In fact, we haven't done anything (yet) so we might as well return
here.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index ab3257a..42e5c40 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4578,7 +4578,7 @@ int ata_device_add(const struct ata_prob
ap = ata_host_add(ent, host_set, i);
if (!ap)
- goto err_out;
+ return 0;
host_set->ports[i] = ap;
xfer_mode_mask =(ap->udma_mask << ATA_SHIFT_UDMA) |
next reply other threads:[~2006-03-13 9:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-13 9:14 Hannes Reinecke [this message]
2006-03-13 9:26 ` [PATCH] libata crashes on incorrectly initialised ports Jeff Garzik
2006-03-13 10:00 ` Hannes Reinecke
2006-03-13 10:09 ` Jeff Garzik
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=44153810.10702@suse.de \
--to=hare@suse.de \
--cc=linux-ide@vger.kernel.org \
--cc=rdunlap@xenotime.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 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).