From: Dan Carpenter <error27@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
kernel-janitors@vger.kernel.org,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Andre Renaud <andre@bluewatersys.com>,
linux-mtd@lists.infradead.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: [patch] mtd/sst25l: check for null consistently
Date: Sat, 22 May 2010 20:16:26 +0000 [thread overview]
Message-ID: <20100522201626.GJ22515@bicker> (raw)
The rest of the function assumes that "data" can be null. I don't know
the code well enough to say whether it can actually be null, but there
is no harm in checking here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index ab5d8cd..684247a 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -454,7 +454,7 @@ static int __init sst25l_probe(struct spi_device *spi)
parts, nr_parts);
}
- } else if (data->nr_parts) {
+ } else if (data && data->nr_parts) {
dev_warn(&spi->dev, "ignoring %d default partitions on %s\n",
data->nr_parts, data->name);
}
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>,
kernel-janitors@vger.kernel.org,
H Hartley Sweeten <hsweeten@visionengravers.com>,
Andre Renaud <andre@bluewatersys.com>,
linux-mtd@lists.infradead.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: [patch] mtd/sst25l: check for null consistently
Date: Sat, 22 May 2010 22:16:26 +0200 [thread overview]
Message-ID: <20100522201626.GJ22515@bicker> (raw)
The rest of the function assumes that "data" can be null. I don't know
the code well enough to say whether it can actually be null, but there
is no harm in checking here.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c
index ab5d8cd..684247a 100644
--- a/drivers/mtd/devices/sst25l.c
+++ b/drivers/mtd/devices/sst25l.c
@@ -454,7 +454,7 @@ static int __init sst25l_probe(struct spi_device *spi)
parts, nr_parts);
}
- } else if (data->nr_parts) {
+ } else if (data && data->nr_parts) {
dev_warn(&spi->dev, "ignoring %d default partitions on %s\n",
data->nr_parts, data->name);
}
next reply other threads:[~2010-05-22 20:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-22 20:16 Dan Carpenter [this message]
2010-05-22 20:16 ` [patch] mtd/sst25l: check for null consistently Dan Carpenter
2010-06-12 14:21 ` Artem Bityutskiy
2010-06-12 14:21 ` Artem Bityutskiy
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=20100522201626.GJ22515@bicker \
--to=error27@gmail.com \
--cc=Artem.Bityutskiy@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=andre@bluewatersys.com \
--cc=dwmw2@infradead.org \
--cc=hsweeten@visionengravers.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.