Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b96918a authored by Ramax Lo's avatar Ramax Lo Committed by Ben Dooks
Browse files

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: default avatarRamax Lo <ramaxlo@gmail.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 004b3506
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ static int __init s3c_nand_copy_set(struct s3c2410_nand_set *set)
			return -ENOMEM;
	}
	
	if (set->nr_map && set->nr_chips) {
		size = sizeof(int) * set->nr_chips;
	if (size) {
		ptr = kmemdup(set->nr_map, size, GFP_KERNEL);
		set->nr_map = ptr;