]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: add offset and length checks to the API function
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Feb 2012 12:34:14 +0000 (14:34 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:28:05 +0000 (00:28 +0100)
commit362cf8c9cac4a995519c130617af4c842fadb073
tree3aa97da098ac7417bc3ef8bc9b1a3e5b531ed268
parent3e5cae2da495432d58bd466a70d8ae89d272b8b7
mtd: add offset and length checks to the API function

Add verification of the offset and length to MTD API functions and verify that
MTD device offset and length are within MTD device size.

The modified API functions are:

'mtd_erase()'
'mtd_point()'
'mtd_unpoint()'
'mtd_get_unmapped_area()'
'mtd_read()'
'mtd_write()'
'mtd_panic_write()'
'mtd_lock()'
'mtd_unlock()'
'mtd_is_locked()'
'mtd_block_isbad()'
'mtd_block_markbad()'

This patch also uninlines these functions and exports in mtdcore.c because they
are not performance-critical and do not have to be inlined.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtdcore.c
include/linux/mtd/mtd.h