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?

> +
> +             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()?

Thanks,

Bart.

Reply via email to