aboutsummaryrefslogtreecommitdiffstats
path: root/net/lapb/lapb_timer.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-04-25 07:28:36 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-04-28 13:58:07 -0400
commit53032dafc6b93ac178ca2340ff8eb4ee2b3d1a92 (patch)
treea0bc0e11440df935a1a3b74f04cb91485fa2cd0a /net/lapb/lapb_timer.c
parentcd78dfc6c6e321a310a73ef7b0df3d262704dd55 (diff)
regulator core: fix double-free in regulator_register() error path
During regulator registration, any error after device_register() will cause a double-free on the struct regulator_dev 'rdev'. The bug is in drivers/regulator/core.c:regulator_register(): ... scrub: device_unregister(&rdev->dev); clean: kfree(rdev); <--- rdev = ERR_PTR(ret); goto out; ... device_unregister() calls regulator_dev_release() which frees rdev. The subsequent kfree corrupts memory and causes some OMAP3 systems to oops on boot in regulator_get(). Applies against 2.6.30-rc3. Signed-off-by: Paul Walmsley <paul@pwsan.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions
b">unsigned long size) __attribute__((const)); static inline int get_order(unsigned long size) { int order; size = (size - 1) >> (PAGE_SHIFT - 1); order = -1; do { size >>= 1; order++; } while (size); return order; } #endif /* __ASSEMBLY__ */ #include <asm/page_offset.h> #define __PAGE_OFFSET (PAGE_OFFSET_RAW) #define PAGE_OFFSET ((unsigned long) __PAGE_OFFSET) /* * main RAM and kernel working space are coincident at 0x90000000, but to make * life more interesting, there's also an uncached virtual shadow at 0xb0000000 * - these mappings are fixed in the MMU */ #define __pfn_disp (CONFIG_KERNEL_RAM_BASE_ADDRESS >> PAGE_SHIFT) #define __pa(x) ((unsigned long)(x)) #define __va(x) ((void *)(unsigned long)(x)) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) #define pfn_to_page(pfn) (mem_map + ((pfn) - __pfn_disp)) #define page_to_pfn(page) ((unsigned long)((page) - mem_map) + __pfn_disp) #define pfn_valid(pfn) \ ({ \ unsigned long __pfn = (pfn) - __pfn_disp; \ __pfn < max_mapnr; \ }) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) #define VM_DATA_DEFAULT_FLAGS \ (VM_READ | VM_WRITE | \ ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0) | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) #endif /* __KERNEL__ */ #endif /* _ASM_PAGE_H */