From: Jiri Slaby <jslaby@suse.cz>
To: corbet@lwn.net
Cc: linux-kernel@vger.kernel.org, Jiri Slaby <jslaby@suse.cz>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Subject: [PATCH] media: atomisp: do not free kmalloc memory by vfree
Date: Fri, 17 Jul 2020 10:05:58 +0200 [thread overview]
Message-ID: <20200717080558.24829-1-jslaby@suse.cz> (raw)
In-Reply-To: <b7636799383bfb85c59d27e140a3c0e56d4af87d.camel@perches.com>
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;
--
2.27.0
next prev parent reply other threads:[~2020-07-17 8:06 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 ` Jiri Slaby [this message]
2020-07-17 8:40 ` [PATCH] media: atomisp: do not free kmalloc memory by vfree Jiri Slaby
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=20200717080558.24829-1-jslaby@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®