linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: mikem@beardog.cca.cpqcorp.net
Cc: Joe Perches <joe@perches.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: cciss update [1/2] updates our SCSI support to not use deprecated headers pass 3
Date: Thu, 14 Oct 2004 02:08:04 +0200	[thread overview]
Message-ID: <20041014000804.GA1454@suse.de> (raw)
In-Reply-To: <20041013223344.GB6019@beardog.cca.cpqcorp.net>

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


      reply	other threads:[~2004-10-14  0:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13 21:13 cciss update [1/2] updates our SCSI support to not use deprecated headers mike.miller
2004-10-13 21:21 ` Jeff Garzik
2004-10-13 21:36   ` mikem
     [not found]     ` <1097704228.3062.1.camel@localhost.localdomain>
2004-10-13 22:33       ` cciss update [1/2] updates our SCSI support to not use deprecated headers pass 3 mike.miller
2004-10-14  0:08         ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041014000804.GA1454@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@osdl.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mikem@beardog.cca.cpqcorp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).