Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] davinci: ccdc_update_raw_params() frees the wrong thing

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>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Al Viro and committed by
Mauro Carvalho Chehab
c1ae8f3a 47de9bf8

+1 -1
+1 -1
drivers/media/platform/davinci/dm644x_ccdc.c
··· 261 261 */ 262 262 if (raw_params->fault_pxl.fp_num != config_params->fault_pxl.fp_num) { 263 263 if (fpc_physaddr != NULL) { 264 - free_pages((unsigned long)fpc_physaddr, 264 + free_pages((unsigned long)fpc_virtaddr, 265 265 get_order 266 266 (config_params->fault_pxl.fp_num * 267 267 FP_NUM_BYTES));