Skip to content

Commit

Permalink
ARM: S3C: Fix NAND device registration by s3c_nand_set_platdata().
Browse files Browse the repository at this point in the history
Fix two bugs in s3c_nand_set_platdata() where thet device's platform
data was not set, and the wrong error check was being performed on
the return of s3c_nand_copy_set().

Fixes the following OOPS:

Unable to handle kernel NULL pointer dereference at virtual address 00000004
PC is at s3c24xx_nand_probe+0x234/0x594

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Ben Dooks committed Dec 23, 2009
1 parent ce8877b commit 2b542a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/plat-s3c/dev-nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ void __init s3c_nand_set_platdata(struct s3c2410_platform_nand *nand)

for (i = 0; i < npd->nr_sets; i++) {
ret = s3c_nand_copy_set(to);
if (!ret) {
if (ret) {
printk(KERN_ERR "%s: failed to copy set %d\n",
__func__, i);
return;
}
to++;
}
}

s3c_device_nand.dev.platform_data = npd;
}

EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);

0 comments on commit 2b542a1

Please sign in to comment.