summaryrefslogtreecommitdiffstats
path: root/fs/jffs/jffs_fm.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs/jffs_fm.c')
-rw-r--r--fs/jffs/jffs_fm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/jffs/jffs_fm.c b/fs/jffs/jffs_fm.c
index 077258b2103e..5a95fbdd6fdb 100644
--- a/fs/jffs/jffs_fm.c
+++ b/fs/jffs/jffs_fm.c
@@ -17,6 +17,7 @@
*
*/
#include <linux/slab.h>
+#include <linux/err.h>
#include <linux/blkdev.h>
#include <linux/jffs.h>
#include "jffs_fm.h"
@@ -104,7 +105,7 @@ jffs_build_begin(struct jffs_control *c, int unit)
mtd = get_mtd_device(NULL, unit);
- if (!mtd) {
+ if (IS_ERR(mtd)) {
kfree(fmc);
DJM(no_jffs_fmcontrol--);
return NULL;
OpenPOWER on IntegriCloud