]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/memstick/core/mspro_block.c: fix attributes array allocation
authorMichal Nazarewicz <mina86@mina86.com>
Tue, 12 Nov 2013 23:11:39 +0000 (15:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Nov 2013 03:09:35 +0000 (12:09 +0900)
commit9febb51f7e03f464a1ab9f399cc51e9f226e4edc
treec0c01ad705af5a08782d2eb03122db0f5475af68
parent38ba0d53b76450a0497b153b08789972dad91b3c
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/memstick/core/mspro_block.c