OSDN Git Service

fs: Preserve error code in get_empty_filp(), part 2
[android-x86/kernel.git] / ipc / shm.c
index 8c9402d..de389e6 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -1042,7 +1042,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr,
                          is_file_hugepages(shp->shm_file) ?
                                &shm_file_operations_huge :
                                &shm_file_operations);
-       if (!file)
+       err = PTR_ERR(file);
+       if (IS_ERR(file))
                goto out_free;
 
        file->private_data = sfd;