From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932707AbcHYTDm (ORCPT ); Thu, 25 Aug 2016 15:03:42 -0400 Received: from sw.attotech.com ([208.69.85.34]:40535 "EHLO NOTESERV1.attotech.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932388AbcHYTDj (ORCPT ); Thu, 25 Aug 2016 15:03:39 -0400 X-Greylist: delayed 962 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Aug 2016 15:02:02 EDT Subject: Re: [PATCH] scsi: not need to alloc zero buffer for local_atto_ioctl To: Shawn Lin , Bradley Grove , jejb@linux.vnet.ibm.com, "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org From: Bradley Grove Message-ID: <3abcfebd-8267-e0dd-6594-00ef2f18471a@attotech.com> Date: Thu, 25 Aug 2016 14:45:36 -0400 In-Reply-To: <1471746809-31218-1-git-send-email-shawn.lin@rock-chips.com> Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252; format=flowed References: <1471746809-31218-1-git-send-email-shawn.lin@rock-chips.com> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on NOTESERV1/SERV/ATTO(Release 9.0 HF1131|December 16, 2014) at 08/25/2016 02:45:36 PM X-Disclaimed: 13711 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Acked-by: Bradley Grove On 08/20/2016 10:33 PM, Shawn Lin wrote: > We don't need to use kzalloc as we will always memset the > local_atto_ioctl later. > > Signed-off-by: Shawn Lin > --- > > drivers/scsi/esas2r/esas2r_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c > index 2aca4d1..5092c82 100644 > --- a/drivers/scsi/esas2r/esas2r_main.c > +++ b/drivers/scsi/esas2r/esas2r_main.c > @@ -194,7 +194,7 @@ static ssize_t write_hw(struct file *file, struct kobject *kobj, > int length = min(sizeof(struct atto_ioctl), count); > > if (!a->local_atto_ioctl) { > - a->local_atto_ioctl = kzalloc(sizeof(struct atto_ioctl), > + a->local_atto_ioctl = kmalloc(sizeof(struct atto_ioctl), > GFP_KERNEL); > if (a->local_atto_ioctl == NULL) { > esas2r_log(ESAS2R_LOG_WARN, > This electronic transmission and any attachments hereto are intended only for the use of the individual or entity to which it is addressed and may contain confidential information belonging to ATTO Technology, Inc. If you have reason to believe that you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this electronic transmission is strictly prohibited. If you have reason to believe that you have received this transmission in error, please notify ATTO immediately by return e-mail and delete and destroy this communication.