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


Groups > linux.kernel > #1296381 > unrolled thread

[POC][PATCH 22/83] [davinci] ccdc_update_raw_params() frees the wrong thing

Started byAl Viro <viro@ZenIV.linux.org.uk>
First post2015-12-22 01:10 +0100
Last post2015-12-22 01:10 +0100
Articles 1 — 1 participant

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

  [POC][PATCH 22/83] [davinci] ccdc_update_raw_params() frees the wrong thing Al Viro <viro@ZenIV.linux.org.uk> - 2015-12-22 01:10 +0100

#1296381 — [POC][PATCH 22/83] [davinci] ccdc_update_raw_params() frees the wrong thing

FromAl Viro <viro@ZenIV.linux.org.uk>
Date2015-12-22 01:10 +0100
Subject[POC][PATCH 22/83] [davinci] ccdc_update_raw_params() frees the wrong thing
Message-ID<qIiGF-50N-71@gated-at.bofh.it>
From: Al Viro <viro@zeniv.linux.org.uk>

	Passing a physical address to free_pages() is a bad idea.
config_params->fault_pxl.fpc_table_addr is set to virt_to_phys()
of __get_free_pages() return value; what we should pass to free_pages()
is its phys_to_virt().  ccdc_close() does that properly, but
ccdc_update_raw_params() doesn't.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/media/platform/davinci/dm644x_ccdc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/davinci/dm644x_ccdc.c b/drivers/media/platform/davinci/dm644x_ccdc.c
index 31d4015..42df06f 100644
--- a/drivers/media/platform/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/davinci/dm644x_ccdc.c
@@ -261,7 +261,7 @@ static int ccdc_update_raw_params(struct ccdc_config_params_raw *raw_params)
 	 */
 	if (raw_params->fault_pxl.fp_num != config_params->fault_pxl.fp_num) {
 		if (fpc_physaddr != NULL) {
-			free_pages(fpc_physaddr,
+			free_pages(fpc_virtaddr,
 				   get_order
 				   (config_params->fault_pxl.fp_num *
 				   FP_NUM_BYTES));
-- 
2.1.4

--
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] | [standalone]


Back to top | Article view | linux.kernel


csiph-web