Thread (14 messages) 14 messages, 5 authors, 2012-02-02
STALE5228d
Revisions (2)
  1. rfc [diff vs current]
  2. rfc current

[PATCH RFC 1/2] mtd : Prevent the NULL pointer access

From: computersforpeace@gmail.com (Brian Norris)
Date: 2012-01-27 19:08:01
Also in: linux-omap

On Mon, Jan 23, 2012 at 12:12 AM, Shubhrajyoti D [off-list ref] wrote:
quoted hunk ↗ jump to hunk
This patch intends to fix the null pointer access.

Signed-off-by: Shubhrajyoti D <redacted>
---
?drivers/mtd/mtdcore.c | ? ?5 +++--
?1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 6ae9ca0..2b3bda7 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -118,8 +118,9 @@ static void mtd_release(struct device *dev)
?static int mtd_cls_suspend(struct device *dev, pm_message_t state)
?{
? ? ? ?struct mtd_info *mtd = dev_get_drvdata(dev);
-
- ? ? ? return mtd_suspend(mtd);
+ ? ? ? if (mtd)
+ ? ? ? ? ? ? ? return mtd_suspend(mtd);
+ ? ? ? return 0;
?}

?static int mtd_cls_resume(struct device *dev)
Forgot this patch was here; this fix is also covered in
l2-mtd-2.6.git, waiting for inclusion in the 3.3-rcX release cycle.
Thanks for the work though!

Brian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help