Re: DAC960 breakage, 2.5 bk current

From: Andrew Morton (akpm@digeo.com)
Date: Fri May 16 2003 - 22:49:20 EST


Kevin Brosius <cobra@compuserve.com> wrote:
>
> kernel NULL pointer deref - virt 00000019
> Oops: 0000 [#1]
> CPU: 0
> EIP: 0060:[<c02774d3>] Not tainted
> EFLAGS: 00010286
> EIP is at DAC960_ioctl+0x33/0x190
>
> Process swapper (pid: 1, ...)
>
> Call Trace:
> ] blkdev_ioctl+0xa5/0x466
> ] ioctl_by_dev+0x41/0x50

You tricking me. That's "ioctl_by_bdev". It passes in a null file*, and
we have to handle it.

Does this fix?

diff -puN drivers/block/DAC960.c~DAC960-oops-fix drivers/block/DAC960.c
--- 25/drivers/block/DAC960.c~DAC960-oops-fix 2003-05-16 20:44:52.000000000 -0700
+++ 25-akpm/drivers/block/DAC960.c 2003-05-16 20:45:16.000000000 -0700
@@ -102,7 +102,7 @@ static int DAC960_ioctl(struct inode *in
         int drive_nr = (int)disk->private_data;
         struct hd_geometry g, *loc = (struct hd_geometry *)arg;
 
- if (file->f_flags & O_NONBLOCK)
+ if (file && file->f_flags & O_NONBLOCK)
                 return DAC960_UserIOCTL(inode, file, cmd, arg);
 
         if (cmd != HDIO_GETGEO || !loc)

_

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



This archive was generated by hypermail 2b29 : Fri May 23 2003 - 22:00:27 EST