aboutsummaryrefslogtreecommitdiff
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 29b68d939bd..6aab317f56e 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;