[PATCH 4/5] megaraid_sas: Move poll_aen_lock initializer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cc: stable

James/linux-scsi,

The following patch from Kashyap Desai for megaraid_sas 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@xxxxxxx>
Signed-off-by: Adam Radford <aradford@xxxxxxxxx>

diff -Naur scsi/drivers/scsi/megaraid/megaraid_sas_base.c
scsi.new/drivers/scsi/megaraid/megaraid_sas_base.c
--- scsi/drivers/scsi/megaraid/megaraid_sas_base.c	2012-07-17
14:57:32.890231627 -0700
+++ scsi.new/drivers/scsi/megaraid/megaraid_sas_base.c	2012-07-17
14:59:37.285232167 -0700
@@ -4095,7 +4095,6 @@
 	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);
@@ -5421,6 +5420,8 @@
 	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;

Attachment: megaraid_sas.patch4
Description: Binary data


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux