* [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation
@ 2011-03-10 20:22 Stephen M. Cameron
2011-03-11 19:09 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: Stephen M. Cameron @ 2011-03-10 20:22 UTC (permalink / raw)
To: axboe; +Cc: mikem, akpm, thenzl, linux-kernel, smcameron
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
This bit got lost somewhere along the way. Without this, panic.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
drivers/block/cciss_scsi.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 514470d..6961002 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -222,7 +222,12 @@ scsi_cmd_stack_setup(ctlr_info_t *h, struct cciss_scsi_adapter_data_t *sa)
sa->cmd_sg_list = NULL;
return -ENOMEM;
}
-
+ stk->elem = kmalloc(sizeof(stk->elem[0]) * stk->nelems, GFP_KERNEL);
+ if (!stk->elem) {
+ pci_free_consistent(h->pdev, size, stk->pool,
+ stk->cmd_pool_handle);
+ return -1;
+ }
for (i = 0; i < stk->nelems; i++) {
stk->elem[i] = &stk->pool[i];
stk->elem[i]->busaddr = (__u32) (stk->cmd_pool_handle +
@@ -252,6 +257,8 @@ scsi_cmd_stack_free(ctlr_info_t *h)
pci_free_consistent(h->pdev, size, stk->pool, stk->cmd_pool_handle);
stk->pool = NULL;
cciss_free_sg_chain_blocks(sa->cmd_sg_list, stk->nelems);
+ kfree(stk->elem);
+ stk->elem = NULL;
}
#if 0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation
2011-03-10 20:22 [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation Stephen M. Cameron
@ 2011-03-11 19:09 ` Jens Axboe
2011-03-11 19:46 ` scameron
0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2011-03-11 19:09 UTC (permalink / raw)
To: Stephen M. Cameron; +Cc: mikem, akpm, thenzl, linux-kernel, smcameron
On 2011-03-10 21:22, Stephen M. Cameron wrote:
> From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
>
> This bit got lost somewhere along the way. Without this, panic.
This doesn't apply cleanly, neither hunk. I hand applied it. Please let
me know what a patch is against in the future, if it doesn't apply
"anywhere".
I marked this one as stable backport, too.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation
2011-03-11 19:09 ` Jens Axboe
@ 2011-03-11 19:46 ` scameron
2011-03-11 20:08 ` Jens Axboe
0 siblings, 1 reply; 4+ messages in thread
From: scameron @ 2011-03-11 19:46 UTC (permalink / raw)
To: Jens Axboe; +Cc: mikem, akpm, thenzl, linux-kernel, smcameron, scameron
On Fri, Mar 11, 2011 at 08:09:39PM +0100, Jens Axboe wrote:
> On 2011-03-10 21:22, Stephen M. Cameron wrote:
> > From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
> >
> > This bit got lost somewhere along the way. Without this, panic.
>
> This doesn't apply cleanly, neither hunk. I hand applied it. Please let
> me know what a patch is against in the future, if it doesn't apply
> "anywhere".
Oh... I see what happened.
That patch was fixing something which was accidentally
left out of this patch:
http://marc.info/?l=linux-kernel&m=129840572232151&w=2
which I mistakenly thought was present in 2.6.38-rc7,
but it's not present (quite likely because without the
missing bit, it causes a panic), It's sitting in my stack of
patches still.
[scameron@localhost linux-2.6.38-rc7]$ stg series | grep cciss
+ cciss-hoist-tag-masking-out-of-loop
+ cciss-inform-controller-we-are-using-32-bit-tags
+ cciss-mask-off-error-bits-before-calling-pci-free-consistent
+ cciss-remove-unnecessary-casts
+ cciss-fix-missed-command-status-value-CMD_UNABORTABLE
+ cciss-add-cciss_tape_cmds-module-parameter
+ cciss-fix-missing-initialization-in-scsi-cmd-stack-setup
+ cciss-export-resettable-host-attribute
+ cciss-fix-sense-data-copying-code
What needs to happen is I combine cciss-add-cciss_tape_cmds-module-parameter
and cciss-fix-missing-initialization-in-scsi-cmd-stack-setup into one
working patch.
Sorry about that. I need to slow down. I'm making too many mistakes.
-- steve
>
> I marked this one as stable backport, too.
>
> --
> Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation
2011-03-11 19:46 ` scameron
@ 2011-03-11 20:08 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2011-03-11 20:08 UTC (permalink / raw)
To: scameron; +Cc: mikem, akpm, thenzl, linux-kernel, smcameron
On 2011-03-11 20:46, scameron@beardog.cce.hp.com wrote:
> On Fri, Mar 11, 2011 at 08:09:39PM +0100, Jens Axboe wrote:
>> On 2011-03-10 21:22, Stephen M. Cameron wrote:
>>> From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
>>>
>>> This bit got lost somewhere along the way. Without this, panic.
>>
>> This doesn't apply cleanly, neither hunk. I hand applied it. Please let
>> me know what a patch is against in the future, if it doesn't apply
>> "anywhere".
>
> Oh... I see what happened.
>
> That patch was fixing something which was accidentally
> left out of this patch:
>
> http://marc.info/?l=linux-kernel&m=129840572232151&w=2
>
> which I mistakenly thought was present in 2.6.38-rc7,
> but it's not present (quite likely because without the
> missing bit, it causes a panic), It's sitting in my stack of
> patches still.
>
> [scameron@localhost linux-2.6.38-rc7]$ stg series | grep cciss
> + cciss-hoist-tag-masking-out-of-loop
> + cciss-inform-controller-we-are-using-32-bit-tags
> + cciss-mask-off-error-bits-before-calling-pci-free-consistent
> + cciss-remove-unnecessary-casts
> + cciss-fix-missed-command-status-value-CMD_UNABORTABLE
> + cciss-add-cciss_tape_cmds-module-parameter
> + cciss-fix-missing-initialization-in-scsi-cmd-stack-setup
> + cciss-export-resettable-host-attribute
> + cciss-fix-sense-data-copying-code
>
> What needs to happen is I combine cciss-add-cciss_tape_cmds-module-parameter
> and cciss-fix-missing-initialization-in-scsi-cmd-stack-setup into one
> working patch.
Please check what is missing for my for-2.6.39/drivers branch and send
me the patches.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-03-11 20:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-10 20:22 [PATCH] cciss: Add missing allocation in scsi_cmd_stack_setup and corresponding deallocation Stephen M. Cameron
2011-03-11 19:09 ` Jens Axboe
2011-03-11 19:46 ` scameron
2011-03-11 20:08 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox