lkml.org 
[lkml]   [2004]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: cciss update [1/2] updates our SCSI support to not use deprecated headers pass 3
On Wed, Oct 13 2004, mike.miller@hp.com wrote:
> @@ -552,11 +547,16 @@ cciss_scsi_setup(int cntl_num)
> static void
> complete_scsi_command( CommandList_struct *cp, int timeout, __u32 tag)
> {
> - Scsi_Cmnd *cmd;
> + struct scsi_cmnd *cmd;
> ctlr_info_t *ctlr;
> u64bit addr64;
> ErrorInfo_struct *ei;
>
> + cmd = kmalloc(sizeof(struct scsi_cmnd), GFP_ATOMIC);
> + if(cmd == NULL) {
> + printk(KERN_WARNING "out of memory\n");
> + return;
> + }
> ei = cp->err_info;
>
> /* First, see if it was a message rather than a command */
> @@ -565,7 +565,7 @@ complete_scsi_command( CommandList_struc
> return;
> }
>
> - cmd = (Scsi_Cmnd *) cp->scsi_cmd;
> + cmd = (struct scsi_cmnd *) cp->scsi_cmd;
> ctlr = hba[cp->ctlr];

This makes zero sense. First of all, you can't just quit out of
completing a command based on a weird allocation failure. Secondly, why
are you allocation cmd at completion time (??) and then overwriting it a
few lines later.

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.039 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site