Skip to content

Commit

Permalink
[SCSI] megaraid_sas: Move poll_aen_lock initializer
Browse files Browse the repository at this point in the history
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: Kashyap Desai <Kashyap.Desai@lsi.com>
Signed-off-by: Adam Radford <aradford@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
  • Loading branch information
Kashyap Desai authored and James Bottomley committed Aug 22, 2012
1 parent 338b131 commit bd8d6dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/megaraid/megaraid_sas_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -4066,7 +4066,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->hba_lock);
spin_lock_init(&instance->completion_lock);
spin_lock_init(&poll_aen_lock);

mutex_init(&instance->aen_mutex);
mutex_init(&instance->reset_mutex);
Expand Down Expand Up @@ -5392,6 +5391,8 @@ static int __init megasas_init(void)
printk(KERN_INFO "megasas: %s %s\n", MEGASAS_VERSION,
MEGASAS_EXT_VERSION);

spin_lock_init(&poll_aen_lock);

support_poll_for_event = 2;
support_device_change = 1;

Expand Down

0 comments on commit bd8d6dd

Please sign in to comment.