lkml.org 
[lkml]   [2000]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectide-tape.c::idetape_init() issues
While compiling 2.3.40-pre6:

ide-tape.c: In function `idetape_init':
ide-tape.c:5854: warning: `tape' might be used uninitialized in this function

Sure enough, it looks like at line 5869 tape->debug_level
is referenced without tape ever being set to a valid memory address.

At first I thought the "right" answer was to just point to drive->driver_data
as is done in other parts of the program:

--- linux-2.3.40-6/drivers/block/ide-tape.c Thu Jan 20 00:44:12 2000
+++ linux/drivers/block/ide-tape.c Thu Jan 20 01:16:47 2000
@@ -5866,6 +5866,7 @@
ide_register_module (&idetape_module);
MOD_DEC_USE_COUNT;
#if ONSTREAM_DEBUG
+ tape = drive->driver_data;
if (tape->debug_level >= 6)
printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n");
#endif
But now I'm unclear about this because of how tape is setup later on
during the idetape_setup() call (idetape_init was hard for me to follow)

In either case it does appear that as it stands, if ONSTREAM_DEBUG
is turned on (which it is by default) and the ide_scan_devices
returns NULL, you'll dereference an invalid pointer.

James
--
Miscellaneous Engineer --- IBM Netfinity Performance Development

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.030 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site