summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Domsch <matt_domsch@dell.com>2004-11-12 19:23:32 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-12 19:23:32 -0800
commite45d557978b136ddc8f40656e8fe0be18d8f7a19 (patch)
tree07af3bdb5592db5569cd67938e9eddf92934515e
parente939871562e9c127a931699df27a594d8b77ad83 (diff)
[PATCH] EDD: fix too short array
Bingo... edd_devices[] was too short. When we keep more than 6 signatures, it overruns the end. Also, I rewrote edd_num_devices to be clearer about its goal. This patch is necessary even after the last edd.S patch was reverted. Thanks to Christian Kujau for testing and narrowing it down enough to debug this. It still doesn't explain why Christian's BIOS reports more devices than he has, that's still up in the air, so don't re-apply the edd.S patch just reverted. Signed-off-by: Matt Domsch <Matt_Domsch@dell.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/firmware/edd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 47d430a339cb..33b669e6f977 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -70,7 +70,7 @@ struct edd_attribute {
static int edd_dev_is_type(struct edd_device *edev, const char *type);
static struct pci_dev *edd_get_pci_dev(struct edd_device *edev);
-static struct edd_device *edd_devices[EDDMAXNR];
+static struct edd_device *edd_devices[EDD_MBR_SIG_MAX];
#define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
struct edd_attribute edd_attr_##_name = { \
@@ -728,9 +728,9 @@ edd_device_register(struct edd_device *edev, int i)
static inline int edd_num_devices(void)
{
- return min_t(unsigned char,
- max_t(unsigned char, edd.edd_info_nr, edd.mbr_signature_nr),
- max_t(unsigned char, EDD_MBR_SIG_MAX, EDDMAXNR));
+ return max_t(unsigned char,
+ min_t(unsigned char, EDD_MBR_SIG_MAX, edd.mbr_signature_nr),
+ min_t(unsigned char, EDDMAXNR, edd.edd_info_nr));
}
/**