All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: corbet@lwn.net
Cc: linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: Re: [PATCH] media: atomisp: do not free kmalloc memory by vfree
Date: Fri, 17 Jul 2020 10:40:05 +0200	[thread overview]
Message-ID: <4e1664f0-8ec1-7427-2bc5-871810a5cc31@suse.cz> (raw)
In-Reply-To: <20200717080558.24829-1-jslaby@suse.cz>

Sorry Jon, wrong To: field, this was supposed to be addressed to Mauro
(who is CCed).

On 17. 07. 20, 10:05, Jiri Slaby wrote:
> fw_minibuffer[i].buffer is allocated by kmalloc in sh_css_load_blob_info
> and by vmalloc in setup_binary. So use kvfree to decide which of those
> allocators to use for freeing.
> 
> Also remove the useless cast.
> 
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  drivers/staging/media/atomisp/pci/sh_css_firmware.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> index d4ab15b6d1ac..d0011b1d97ed 100644
> --- a/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> +++ b/drivers/staging/media/atomisp/pci/sh_css_firmware.c
> @@ -358,7 +358,7 @@ void sh_css_unload_firmware(void)
>  			if (fw_minibuffer[i].name)
>  				kfree((void *)fw_minibuffer[i].name);
>  			if (fw_minibuffer[i].buffer)
> -				vfree((void *)fw_minibuffer[i].buffer);
> +				kvfree(fw_minibuffer[i].buffer);
>  		}
>  		kfree(fw_minibuffer);
>  		fw_minibuffer = NULL;
> 


-- 
js
suse labs

  reply	other threads:[~2020-07-17  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23  6:11 [PATCH] MAINTAINERS: use my kernel.org address Jiri Slaby
2020-06-23  6:32 ` Joe Perches
2020-06-23  8:09   ` [PATCH v2] " Jiri Slaby
2020-06-26 15:33     ` Jonathan Corbet
2020-07-17  8:05   ` [PATCH] media: atomisp: do not free kmalloc memory by vfree Jiri Slaby
2020-07-17  8:40     ` Jiri Slaby [this message]
2021-02-19 10:12 Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e1664f0-8ec1-7427-2bc5-871810a5cc31@suse.cz \
    --to=jslaby@suse.cz \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.