From: Dave Olien <dmo@osdl.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] DAC960 fix for NULL dereference in open()
Date: Fri, 15 Aug 2003 10:21:30 -0700 [thread overview]
Message-ID: <20030815172130.GA2325@osdl.org> (raw)
This patch fixes a problem that's been hidden for a while. DAC960_open()
will try to dereference a NULL pointer if an application opens
(for example) /dev/rd/c0d12 when there has never been a logical device
created for that file.
diff -ur linux-2.6.0-test3_mm2_original/drivers/block/DAC960.c linux-2.6.0-test3_mm2_DAC/drivers/block/DAC960.c
--- linux-2.6.0-test3_mm2_original/drivers/block/DAC960.c 2003-08-14 14:38:49.000000000 -0700
+++ linux-2.6.0-test3_mm2_DAC/drivers/block/DAC960.c 2003-08-15 09:39:48.000000000 -0700
@@ -82,7 +82,7 @@
} else {
DAC960_V2_LogicalDeviceInfo_T *i =
p->V2.LogicalDeviceInformation[drive_nr];
- if (i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline)
+ if (!i || i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline)
return -ENXIO;
}
reply other threads:[~2003-08-15 17:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030815172130.GA2325@osdl.org \
--to=dmo@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/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