> -----Original Message-----
> From: Bart Van Assche [mailto:[email protected]]
> Sent: Thursday, December 21, 2017 9:54 AM
> To: [email protected]; Raghava Aditya Renukunta
> <[email protected]>; [email protected];
> [email protected]
> Cc: dl-esc-Aacraid Linux Driver <[email protected]>;
> [email protected]; Tom White <[email protected]>;
> Scott Benesh <[email protected]>
> Subject: Re: [PATCH 01/29] scsi: aacraid: Fix udev inquiry race condition
> 
> EXTERNAL EMAIL
> 
> 
> On Thu, 2017-12-21 at 09:33 -0800, Raghava Aditya Renukunta wrote:
> > +             char *cp;
> > +             char *cname = kmalloc(sizeof(sup_adap_info-
> >adapter_type_text),
> > +                                                             GFP_ATOMIC);
> 
> Why did you choose to use GFP_ATOMIC instead of GFP_KERNEL in the
> above
> kmalloc() call?

It was mainly because of a trace call that cut thru the kmalloc call. 
 
> > +
> > +             if (!cname)
> > +                     return;
> > +
> > +             cp = cname;
> > +             memcpy(cname, sup_adap_info->adapter_type_text,
> > +                     sizeof(sup_adap_info->adapter_type_text));
> 
> Is the sup_adap_info->adapter_type_text a string that is \0-terminated? If
> so,
> have you considered to use kmemdup() instead of kmalloc() + memcpy()?

I will take that into consideration Bart.

Thank you 
Raghava Aditya

> Thanks,
> 
> Bart.

Reply via email to