Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1279206 > unrolled thread

Re: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method

Started byBrent Taylor <motobud@gmail.com>
First post2015-11-28 20:00 +0100
Last post2015-11-29 04:00 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method Brent Taylor <motobud@gmail.com> - 2015-11-28 20:00 +0100
    Re: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-29 02:00 +0100
      Re: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-11-29 04:00 +0100

#1279206 — Re: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method

FromBrent Taylor <motobud@gmail.com>
Date2015-11-28 20:00 +0100
SubjectRe: [PATCH] ath6kl: Use vmalloc for loading firmware using api1 method
Message-ID<qzST0-48t-7@gated-at.bofh.it>
Sorry, the first e-mail was sent via gmail and I forgot about sending
it in plain text mode.

Whats the status on this patch?  I don't see it on patchwork anymore
nor is it in any of the git trees I checked.

Thanks,
Brent

On Fri, Oct 16, 2015 at 12:10 AM, Brent Taylor <motobud@gmail.com> wrote:
> Signed-off-by: Brent Taylor <motobud@gmail.com>
> ---
>  drivers/net/wireless/ath/ath6kl/init.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
> index 6e473fa..2155739 100644
> --- a/drivers/net/wireless/ath/ath6kl/init.c
> +++ b/drivers/net/wireless/ath/ath6kl/init.c
> @@ -673,10 +673,17 @@ static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
>                 return ret;
>
>         *fw_len = fw_entry->size;
> -       *fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
> -
> -       if (*fw == NULL)
> -               ret = -ENOMEM;
> +       if (&ar->fw == fw) {
> +               *fw = vmalloc(fw_entry->size);
> +               if (*fw == NULL)
> +                       ret = -ENOMEM;
> +               else
> +                       memcpy(*fw, fw_entry->data, fw_entry->size);
> +       } else {
> +               *fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
> +               if (*fw == NULL)
> +                       ret = -ENOMEM;
> +       }
>
>         release_firmware(fw_entry);
>
> --
> 2.6.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1279254

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2015-11-29 02:00 +0100
Message-ID<qzYvo-7HB-5@gated-at.bofh.it>
In reply to#1279206
On Sat, Nov 28, 2015 at 8:58 PM, Brent Taylor <motobud@gmail.com> wrote:
> Sorry, the first e-mail was sent via gmail and I forgot about sending
> it in plain text mode.
>
> Whats the status on this patch?  I don't see it on patchwork anymore
> nor is it in any of the git trees I checked.
>

You forget to use kvfree() instead of kfree() in core.c.

> Thanks,
> Brent
>
> On Fri, Oct 16, 2015 at 12:10 AM, Brent Taylor <motobud@gmail.com> wrote:
>> Signed-off-by: Brent Taylor <motobud@gmail.com>
>> ---
>>  drivers/net/wireless/ath/ath6kl/init.c | 15 +++++++++++----
>>  1 file changed, 11 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
>> index 6e473fa..2155739 100644
>> --- a/drivers/net/wireless/ath/ath6kl/init.c
>> +++ b/drivers/net/wireless/ath/ath6kl/init.c
>> @@ -673,10 +673,17 @@ static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
>>                 return ret;
>>
>>         *fw_len = fw_entry->size;
>> -       *fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
>> -
>> -       if (*fw == NULL)
>> -               ret = -ENOMEM;
>> +       if (&ar->fw == fw) {
>> +               *fw = vmalloc(fw_entry->size);
>> +               if (*fw == NULL)
>> +                       ret = -ENOMEM;
>> +               else
>> +                       memcpy(*fw, fw_entry->data, fw_entry->size);
>> +       } else {
>> +               *fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
>> +               if (*fw == NULL)
>> +                       ret = -ENOMEM;
>> +       }
>>
>>         release_firmware(fw_entry);
>>
>> --
>> 2.6.1
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/



-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1279260

FromTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date2015-11-29 04:00 +0100
Message-ID<qA0nv-oN-1@gated-at.bofh.it>
In reply to#1279254
Andy Shevchenko wrote:
> On Sat, Nov 28, 2015 at 8:58 PM, Brent Taylor <motobud@gmail.com> wrote:
> > Whats the status on this patch?  I don't see it on patchwork anymore
> > nor is it in any of the git trees I checked.
> >
> 
> You forget to use kvfree() instead of kfree() in core.c.
> 

In addition to that, I think you can do like below.

	if (&ar->fw == fw)
		*fw = vmalloc(fw_entry->size);
	else
		*fw = kmalloc(fw_entry->size, GFP_KERNEL);
	if (*fw == NULL)
		ret = -ENOMEM;
	else
		memcpy(*fw, fw_entry->data, fw_entry->size);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web