]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/memstick/core/mspro_block.c: fix attributes array allocation
authorMichal Nazarewicz <mina86@mina86.com>
Tue, 5 Nov 2013 05:57:46 +0000 (16:57 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:57:46 +0000 (16:57 +1100)
commitb67aed072de7610f49e4870fb3b63edba1da3a7d
treebbbcaca8600e0f6c0d3836737ff91abd2918296c
parenta48c1c85ac804ae02626708d1bc5a7a3f781ec80
drivers/memstick/core/mspro_block.c: fix attributes array allocation

attrs field of attribute_group structure is a pointer to a pointer (as in
an array of pointers) rather than pointer to attribute struct (as in an
array of structures), so when allocating size of the pointer sholud be
used instead of the structure it is pointing to.

While at it, also change the call to use kcalloc rather than kzalloc.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/memstick/core/mspro_block.c