[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4e1664f0-8ec1-7427-2bc5-871810a5cc31@suse.cz>
Date: Fri, 17 Jul 2020 10:40:05 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: corbet@....net
Cc: linux-kernel@...r.kernel.org,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Subject: Re: [PATCH] media: atomisp: do not free kmalloc memory by vfree
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@...e.cz>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@...nel.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
Powered by blists - more mailing lists