提交 9b96918a 编写于 作者: R Ramax Lo 提交者: Ben Dooks

ARM: S3C: NAND: Check the existence of nr_map before copying

Since the structure field nr_map is optional, we need to check whether the
chip number map is provided to avoid unexpected NULL pointer exception.
Signed-off-by: NRamax Lo <ramaxlo@gmail.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 004b3506
......@@ -58,8 +58,8 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
return -ENOMEM;
}
size = sizeof(int) * set->nr_chips;
if (size) {
if (set->nr_map && set->nr_chips) {
size = sizeof(int) * set->nr_chips;
ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
set->nr_map = ptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册