* [PATCH 01/11] completely initialize hw_regs_t in ide_setup_ports
[not found] <20060525002742.723577000@linux-m68k.org>
@ 2006-05-25 0:27 ` zippel
0 siblings, 0 replies; only message in thread
From: zippel @ 2006-05-25 0:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-ide
ide_setup_ports does not completely initialize the hw_regs_t structure
which can cause random failures, as the structure is often on the stack.
None of the callers expect a partially initialized structure, i.e. none
of them do any setup of their own before calling ide_setup_ports().
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
---
drivers/ide/ide.c | 1 +
drivers/ide/legacy/q40ide.c | 1 +
2 files changed, 2 insertions(+)
Index: linux-2.6-mm/drivers/ide/ide.c
===================================================================
--- linux-2.6-mm.orig/drivers/ide/ide.c
+++ linux-2.6-mm/drivers/ide/ide.c
@@ -730,6 +730,7 @@ void ide_setup_ports ( hw_regs_t *hw,
{
int i;
+ memset(hw, 0, sizeof(hw_regs_t));
for (i = 0; i < IDE_NR_PORTS; i++) {
if (offsets[i] == -1) {
switch(i) {
Index: linux-2.6-mm/drivers/ide/legacy/q40ide.c
===================================================================
--- linux-2.6-mm.orig/drivers/ide/legacy/q40ide.c
+++ linux-2.6-mm/drivers/ide/legacy/q40ide.c
@@ -80,6 +80,7 @@ void q40_ide_setup_ports ( hw_regs_t *hw
{
int i;
+ memset(hw, 0, sizeof(hw_regs_t));
for (i = 0; i < IDE_NR_PORTS; i++) {
/* BIG FAT WARNING:
assumption: only DATA port is ever used in 16 bit mode */
--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-25 0:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20060525002742.723577000@linux-m68k.org>
2006-05-25 0:27 ` [PATCH 01/11] completely initialize hw_regs_t in ide_setup_ports zippel
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).