diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2012-11-16 05:38:22 -0500 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-11-18 05:44:38 -0500 |
commit | ded4c55d108e0e4e4ba221b39a782e85d77a5ca0 (patch) | |
tree | 174b12ca34284777de7fd47586b9f09409a5f743 /drivers/mtd/nand | |
parent | 2cbba75a56ea78e6876b4e2547a882f10b3fe72b (diff) |
mtd: s3c2410: Fix potential NULL pointer dereference error
'set' is tested for NULL. But subsequently accessed without the check.
Thus making it conditional to avoid NULL pointer dereferencing.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 295e4bedad96..bbc49c496076 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -730,11 +730,14 @@ static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, | |||
730 | struct s3c2410_nand_mtd *mtd, | 730 | struct s3c2410_nand_mtd *mtd, |
731 | struct s3c2410_nand_set *set) | 731 | struct s3c2410_nand_set *set) |
732 | { | 732 | { |
733 | if (set) | 733 | if (set) { |
734 | mtd->mtd.name = set->name; | 734 | mtd->mtd.name = set->name; |
735 | 735 | ||
736 | return mtd_device_parse_register(&mtd->mtd, NULL, NULL, | 736 | return mtd_device_parse_register(&mtd->mtd, NULL, NULL, |
737 | set->partitions, set->nr_partitions); | 737 | set->partitions, set->nr_partitions); |
738 | } | ||
739 | |||
740 | return -ENODEV; | ||
738 | } | 741 | } |
739 | 742 | ||
740 | /** | 743 | /** |