* [PATCH 4/5] megaraid_sas: Move poll_aen_lock initializer
@ 2012-07-18 1:20 adam radford
2012-07-26 8:38 ` James Bottomley
0 siblings, 1 reply; 2+ messages in thread
From: adam radford @ 2012-07-18 1:20 UTC (permalink / raw)
To: linux-scsi; +Cc: Kashyap Desai, stable
[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]
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@lsi.com>
Signed-off-by: Adam Radford <aradford@gmail.com>
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 #2: megaraid_sas.patch4 --]
[-- Type: application/octet-stream, Size: 756 bytes --]
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 4/5] megaraid_sas: Move poll_aen_lock initializer
2012-07-18 1:20 [PATCH 4/5] megaraid_sas: Move poll_aen_lock initializer adam radford
@ 2012-07-26 8:38 ` James Bottomley
0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2012-07-26 8:38 UTC (permalink / raw)
To: adam radford; +Cc: linux-scsi, Kashyap Desai, stable
On Tue, 2012-07-17 at 18:20 -0700, adam radford wrote:
> Cc: stable
That's not how to add a stable tag, please see
Documentation/stable_kernel_rules.txt
> James/linux-scsi,
>
> The following patch from Kashyap Desai for megaraid_sas moves the
That's also not how you do someone else's patch ... this needs a
From: Kashyap Desai <Kashyap.Desai@lsi.com>
At the top for git to get the authorship correct.
James
> 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>
>
> 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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-26 8:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-18 1:20 [PATCH 4/5] megaraid_sas: Move poll_aen_lock initializer adam radford
2012-07-26 8:38 ` James Bottomley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox