[GFS2] Fix OOM error handling

Fix the OOM error handling in inode.c where it was possible for
a NULL pointer to be dereferenced.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

+3
+3
fs/gfs2/inode.c
··· 157 struct gfs2_glock *io_gl; 158 int error; 159 160 if (inode->i_state & I_NEW) { 161 struct gfs2_sbd *sdp = GFS2_SB(inode); 162 umode_t mode = DT2IF(type);
··· 157 struct gfs2_glock *io_gl; 158 int error; 159 160 + if (!inode) 161 + return ERR_PTR(-ENOBUFS); 162 + 163 if (inode->i_state & I_NEW) { 164 struct gfs2_sbd *sdp = GFS2_SB(inode); 165 umode_t mode = DT2IF(type);