public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: hare@suse.de, JBottomley@odin.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] aic7xxx: replace kmalloc/strcpy by kstrdup
Date: Tue, 14 Jul 2015 12:08:44 +0300	[thread overview]
Message-ID: <20150714090844.GE4341@mwanda> (raw)
In-Reply-To: <4159f01e6450cee8093e7d6a0d979bbeab8243d0.1436858599.git.christophe.jaillet@wanadoo.fr>

On Tue, Jul 14, 2015 at 09:25:16AM +0200, Christophe JAILLET wrote:
> --- a/drivers/scsi/aic7xxx/aic79xx_osm.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
> @@ -1250,9 +1250,8 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa
>  	ahd_set_unit(ahd, ahd_linux_unit++);
>  	ahd_unlock(ahd, &s);
>  	sprintf(buf, "scsi%d", host->host_no);
> -	new_name = kmalloc(strlen(buf) + 1, GFP_ATOMIC);
> +	new_name = kstrdup(buf, GFP_ATOMIC);
>  	if (new_name != NULL) {
> -		strcpy(new_name, buf);
>  		ahd_set_name(ahd, new_name);
>  	}

Remove the curly braces.  And below as well.

regards,
dan carpenter


  reply	other threads:[~2015-07-14  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14  7:25 [PATCH] aic7xxx: replace kmalloc/strcpy by kstrdup Christophe JAILLET
2015-07-14  9:08 ` Dan Carpenter [this message]
2015-07-14 10:02 ` [PATCH v2] " Christophe JAILLET
2015-07-14 10:07   ` Hannes Reinecke
2015-07-14 11:27     ` walter harms

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=20150714090844.GE4341@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=JBottomley@odin.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=hare@suse.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /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