Commit 2685d137 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] DAC960 oops fix

ioctl_by_bdev() passes in a NULL file*, so we had better not dereference it.
parent c6c9afeb
......@@ -102,7 +102,7 @@ static int DAC960_ioctl(struct inode *inode, struct file *file,
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment