提交 a4b81ca5 编写于 作者: D Dan Carpenter 提交者: David Woodhouse

mtd: sst25l: check for null consistently

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 00b275db
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册