summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2011-01-30 20:29:38 +0100
committerKevin Hilman <khilman@ti.com>2011-01-31 21:59:15 +0100
commit8353584eae4af8f37e5a23b63ed816c79185a9c9 (patch)
tree30e6b3a32c97b6347a6dcd109352ef08766642c3
parentOMAP: PM: SmartReflex: Fix possible memory leak (diff)
downloadlinux-8353584eae4af8f37e5a23b63ed816c79185a9c9.tar.xz
linux-8353584eae4af8f37e5a23b63ed816c79185a9c9.zip
OMAP: PM: SmartReflex: Fix possible null pointer read access
These errors were found by cppcheck: arch/arm/mach-omap2/smartreflex.c:784: error: Possible null pointer dereference: sr_info arch/arm/mach-omap2/smartreflex.c:799: error: Possible null pointer dereference: sr_info Both conditional statements are executed when sr_info == NULL, so accessing sr_info->voltdm would fail. Cc: Russell King <linux@arm.linux.org.uk> Cc: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Hilman <khilman@ti.com>
-rw-r--r--arch/arm/mach-omap2/smartreflex.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
index 5f429b96fc93..c37e823266d3 100644
--- a/arch/arm/mach-omap2/smartreflex.c
+++ b/arch/arm/mach-omap2/smartreflex.c
@@ -780,8 +780,7 @@ static int omap_sr_autocomp_show(void *data, u64 *val)
struct omap_sr *sr_info = (struct omap_sr *) data;
if (!sr_info) {
- pr_warning("%s: omap_sr struct for sr_%s not found\n",
- __func__, sr_info->voltdm->name);
+ pr_warning("%s: omap_sr struct not found\n", __func__);
return -EINVAL;
}
@@ -795,8 +794,7 @@ static int omap_sr_autocomp_store(void *data, u64 val)
struct omap_sr *sr_info = (struct omap_sr *) data;
if (!sr_info) {
- pr_warning("%s: omap_sr struct for sr_%s not found\n",
- __func__, sr_info->voltdm->name);
+ pr_warning("%s: omap_sr struct not found\n", __func__);
return -EINVAL;
}