diff options
author | David Rientjes <[email protected]> | 2009-08-26 14:29:22 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2009-08-26 20:06:52 -0700 |
commit | b62e408c05228f40e69bb38a48db8961cac6cd23 (patch) | |
tree | 40711bad4a60adb8f331d71574ec61e13c5a352d /drivers/mtd/lpddr/lpddr_cmds.c | |
parent | 8e7ee27095aee87b5db1b0061e2ceea5878a1bbd (diff) |
flex_array: convert element_nr formals to unsigned
It's problematic to allow signed element_nr's or total's to be passed as
part of the flex array API.
flex_array_alloc() allows total_nr_elements to be set to a negative
quantity, which is obviously erroneous.
flex_array_get() and flex_array_put() allows negative array indices in
dereferencing an array part, which could address memory mapped before
struct flex_array.
The fix is to convert all existing element_nr formals to be qualified as
unsigned. Existing checks to compare it to total_nr_elements or the max
array size based on element_size need not be changed.
Signed-off-by: David Rientjes <[email protected]>
Cc: Dave Hansen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/mtd/lpddr/lpddr_cmds.c')
0 files changed, 0 insertions, 0 deletions