Fix a potential NULL pointer dereference.
If there is no file or directory, it has to check whether it's error or
not.
Change-Id: Ia6e7280c1901ae772a5f890c312b7a741fbac0a1
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
mm_segment_t old_fs = force_uaccess_begin();
file = filp_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
mm_segment_t old_fs = force_uaccess_begin();
file = filp_open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0644);
struct super_block *sb = file->f_path.dentry->d_sb;
if (cmd) {
struct super_block *sb = file->f_path.dentry->d_sb;
if (cmd) {