Commit fb225ce3 authored by Kashyap Desai's avatar Kashyap Desai Committed by Ben Hutchings

megaraid_sas: Move poll_aen_lock initializer

commit bd8d6dd4 upstream.

The following patch moves the poll_aen_lock initializer from
megasas_probe_one() to megasas_init().  This prevents a crash when a user
loads the driver and tries to issue a poll() system call on the ioctl
interface with no adapters present.
Signed-off-by: default avatarKashyap Desai <Kashyap.Desai@lsi.com>
Signed-off-by: default avatarAdam Radford <aradford@gmail.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent f64c045a
...@@ -4125,7 +4125,6 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -4125,7 +4125,6 @@ megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
spin_lock_init(&instance->cmd_pool_lock); spin_lock_init(&instance->cmd_pool_lock);
spin_lock_init(&instance->hba_lock); spin_lock_init(&instance->hba_lock);
spin_lock_init(&instance->completion_lock); spin_lock_init(&instance->completion_lock);
spin_lock_init(&poll_aen_lock);
mutex_init(&instance->aen_mutex); mutex_init(&instance->aen_mutex);
mutex_init(&instance->reset_mutex); mutex_init(&instance->reset_mutex);
...@@ -5520,6 +5519,8 @@ static int __init megasas_init(void) ...@@ -5520,6 +5519,8 @@ static int __init megasas_init(void)
printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION, printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
MEGASAS_EXT_VERSION); MEGASAS_EXT_VERSION);
spin_lock_init(&poll_aen_lock);
support_poll_for_event = 2; support_poll_for_event = 2;
support_device_change = 1; support_device_change = 1;
......
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