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

Merge tag 'remoteproc-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc

Pull remoteproc fixes from Ohad Ben-Cohen:
"Trivial remoteproc fixes by Suman Anna, Wei Yongjun and Thomas Meyer"

* tag 'remoteproc-3.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
remoteproc: Cocci spatch "memdup.spatch"
remoteproc: free carveout memories only after unmapping them
remoteproc/omap: fix a sparse warning
remoteproc: fix checkpatch errors in remoteproc code
remoteproc: fix error return code in rproc_fw_boot()

+16 -17
+12 -12
drivers/remoteproc/remoteproc_core.c
··· 762 762 kfree(entry); 763 763 } 764 764 765 - /* clean up carveout allocations */ 766 - list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { 767 - dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma); 768 - list_del(&entry->node); 769 - kfree(entry); 770 - } 771 - 772 765 /* clean up iommu mapping entries */ 773 766 list_for_each_entry_safe(entry, tmp, &rproc->mappings, node) { 774 767 size_t unmapped; ··· 773 780 unmapped); 774 781 } 775 782 783 + list_del(&entry->node); 784 + kfree(entry); 785 + } 786 + 787 + /* clean up carveout allocations */ 788 + list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { 789 + dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma); 776 790 list_del(&entry->node); 777 791 kfree(entry); 778 792 } ··· 815 815 } 816 816 817 817 rproc->bootaddr = rproc_get_boot_addr(rproc, fw); 818 + ret = -EINVAL; 818 819 819 820 /* look for the resource table */ 820 821 table = rproc_find_rsc_table(rproc, fw, &tablesz); 821 822 if (!table) { 822 - ret = -EINVAL; 823 823 goto clean_up; 824 824 } 825 825 826 826 /* Verify that resource table in loaded fw is unchanged */ 827 827 if (rproc->table_csum != crc32(0, table, tablesz)) { 828 828 dev_err(dev, "resource checksum failed, fw changed?\n"); 829 - ret = -EINVAL; 830 829 goto clean_up; 831 830 } 832 831 ··· 851 852 * copy this information to device memory. 852 853 */ 853 854 loaded_table = rproc_find_loaded_rsc_table(rproc, fw); 854 - if (!loaded_table) 855 + if (!loaded_table) { 856 + ret = -EINVAL; 855 857 goto clean_up; 858 + } 856 859 857 860 memcpy(loaded_table, rproc->cached_table, tablesz); 858 861 ··· 914 913 * will be stored in the cached_table. Before the device is started, 915 914 * cached_table will be copied into devic memory. 916 915 */ 917 - rproc->cached_table = kmalloc(tablesz, GFP_KERNEL); 916 + rproc->cached_table = kmemdup(table, tablesz, GFP_KERNEL); 918 917 if (!rproc->cached_table) 919 918 goto out; 920 919 921 - memcpy(rproc->cached_table, table, tablesz); 922 920 rproc->table_ptr = rproc->cached_table; 923 921 924 922 /* count the number of notify-ids */
+1 -2
drivers/remoteproc/remoteproc_debugfs.c
··· 248 248 249 249 void __exit rproc_exit_debugfs(void) 250 250 { 251 - if (rproc_dbg) 252 - debugfs_remove(rproc_dbg); 251 + debugfs_remove(rproc_dbg); 253 252 }
+2 -2
drivers/remoteproc/remoteproc_internal.h
··· 107 107 108 108 static inline 109 109 struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc, 110 - const struct firmware *fw) 110 + const struct firmware *fw) 111 111 { 112 112 if (rproc->fw_ops->find_loaded_rsc_table) 113 113 return rproc->fw_ops->find_loaded_rsc_table(rproc, fw); 114 114 115 - return NULL; 115 + return NULL; 116 116 } 117 117 118 118 extern const struct rproc_fw_ops rproc_elf_fw_ops;
+1 -1
include/linux/platform_data/remoteproc-omap.h
··· 50 50 51 51 #else 52 52 53 - void __init omap_rproc_reserve_cma(void) 53 + static inline void __init omap_rproc_reserve_cma(void) 54 54 { 55 55 } 56 56