[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200717080558.24829-1-jslaby@suse.cz>
Date: Fri, 17 Jul 2020 10:05:58 +0200
From: Jiri Slaby <jslaby@...e.cz>
To: corbet@....net
Cc: linux-kernel@...r.kernel.org, Jiri Slaby <jslaby@...e.cz>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Subject: [PATCH] media: atomisp: do not free kmalloc memory by vfree
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;
--
2.27.0
Powered by blists - more mailing lists