From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbbGNJJT (ORCPT ); Tue, 14 Jul 2015 05:09:19 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:37537 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751848AbbGNJJR (ORCPT ); Tue, 14 Jul 2015 05:09:17 -0400 Date: Tue, 14 Jul 2015 12:08:44 +0300 From: Dan Carpenter To: Christophe JAILLET 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 Message-ID: <20150714090844.GE4341@mwanda> References: <4159f01e6450cee8093e7d6a0d979bbeab8243d0.1436858599.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4159f01e6450cee8093e7d6a0d979bbeab8243d0.1436858599.git.christophe.jaillet@wanadoo.fr> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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