mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Crash in mtd_cls_suspend because mtd is NULL.
Date: Fri, 3 Feb 2012 10:50:57 +1100	[thread overview]
Message-ID: <20120203105057.11a86f26@notabene.brown> (raw)

[-- Attachment #1: Type: text/plain, Size: 1353 bytes --]


Hi,
 I just tried to suspend my GTA04 (OMAP based mobile phone platform) running
3.3-rc2 and it crashed in mtd_cls_suspend because mtd was NULL.

So for me, it looks like the following patch is a regression.

Is there anything I can do to help find the correct resolution here.

(It has some flash memory but I am not using it at all).

Thanks,
NeilBrown




commit 079c985e7a6f4ce60f931cebfdd5ee3c38347e31
Author: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Date:   Fri Dec 30 17:15:59 2011 +0200

    mtd: do not use mtd->suspend and mtd->resume directly
    
    Just call the 'mtd_suspend()' and 'mtd_resume()' - they will do nothing
    if the operation is not defined.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 66494ee..6ae9ca0 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -119,10 +119,7 @@ static int mtd_cls_suspend(struct device *dev, pm_message_t
 {
        struct mtd_info *mtd = dev_get_drvdata(dev);
 
-       if (mtd && mtd->suspend)
-               return mtd_suspend(mtd);
-       else
-               return 0;
+       return mtd_suspend(mtd);
 }
 
 static int mtd_cls_resume(struct device *dev)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

             reply	other threads:[~2012-02-02 23:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 23:50 NeilBrown [this message]
2012-02-03  4:58 ` Artem Bityutskiy
2012-02-05 22:28   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120203105057.11a86f26@notabene.brown \
    --to=neilb@suse.de \
    --cc=David.Woodhouse@intel.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome