diff options
Diffstat (limited to 'ipc/sem.c')
-rw-r--r-- | ipc/sem.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -438,7 +438,7 @@ static inline struct sem_array *sem_obtain_object_check(struct ipc_namespace *ns | |||
438 | static inline void sem_lock_and_putref(struct sem_array *sma) | 438 | static inline void sem_lock_and_putref(struct sem_array *sma) |
439 | { | 439 | { |
440 | sem_lock(sma, NULL, -1); | 440 | sem_lock(sma, NULL, -1); |
441 | ipc_rcu_putref(sma, ipc_rcu_free); | 441 | ipc_rcu_putref(sma, sem_rcu_free); |
442 | } | 442 | } |
443 | 443 | ||
444 | static inline void sem_rmid(struct ipc_namespace *ns, struct sem_array *s) | 444 | static inline void sem_rmid(struct ipc_namespace *ns, struct sem_array *s) |
@@ -1381,7 +1381,7 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
1381 | rcu_read_unlock(); | 1381 | rcu_read_unlock(); |
1382 | sem_io = ipc_alloc(sizeof(ushort)*nsems); | 1382 | sem_io = ipc_alloc(sizeof(ushort)*nsems); |
1383 | if (sem_io == NULL) { | 1383 | if (sem_io == NULL) { |
1384 | ipc_rcu_putref(sma, ipc_rcu_free); | 1384 | ipc_rcu_putref(sma, sem_rcu_free); |
1385 | return -ENOMEM; | 1385 | return -ENOMEM; |
1386 | } | 1386 | } |
1387 | 1387 | ||
@@ -1415,20 +1415,20 @@ static int semctl_main(struct ipc_namespace *ns, int semid, int semnum, | |||
1415 | if (nsems > SEMMSL_FAST) { | 1415 | if (nsems > SEMMSL_FAST) { |
1416 | sem_io = ipc_alloc(sizeof(ushort)*nsems); | 1416 | sem_io = ipc_alloc(sizeof(ushort)*nsems); |
1417 | if (sem_io == NULL) { | 1417 | if (sem_io == NULL) { |
1418 | ipc_rcu_putref(sma, ipc_rcu_free); | 1418 | ipc_rcu_putref(sma, sem_rcu_free); |
1419 | return -ENOMEM; | 1419 | return -ENOMEM; |
1420 | } | 1420 | } |
1421 | } | 1421 | } |
1422 | 1422 | ||
1423 | if (copy_from_user(sem_io, p, nsems*sizeof(ushort))) { | 1423 | if (copy_from_user(sem_io, p, nsems*sizeof(ushort))) { |
1424 | ipc_rcu_putref(sma, ipc_rcu_free); | 1424 | ipc_rcu_putref(sma, sem_rcu_free); |
1425 | err = -EFAULT; | 1425 | err = -EFAULT; |
1426 | goto out_free; | 1426 | goto out_free; |
1427 | } | 1427 | } |
1428 | 1428 | ||
1429 | for (i = 0; i < nsems; i++) { | 1429 | for (i = 0; i < nsems; i++) { |
1430 | if (sem_io[i] > SEMVMX) { | 1430 | if (sem_io[i] > SEMVMX) { |
1431 | ipc_rcu_putref(sma, ipc_rcu_free); | 1431 | ipc_rcu_putref(sma, sem_rcu_free); |
1432 | err = -ERANGE; | 1432 | err = -ERANGE; |
1433 | goto out_free; | 1433 | goto out_free; |
1434 | } | 1434 | } |
@@ -1720,7 +1720,7 @@ static struct sem_undo *find_alloc_undo(struct ipc_namespace *ns, int semid) | |||
1720 | /* step 2: allocate new undo structure */ | 1720 | /* step 2: allocate new undo structure */ |
1721 | new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL); | 1721 | new = kzalloc(sizeof(struct sem_undo) + sizeof(short)*nsems, GFP_KERNEL); |
1722 | if (!new) { | 1722 | if (!new) { |
1723 | ipc_rcu_putref(sma, ipc_rcu_free); | 1723 | ipc_rcu_putref(sma, sem_rcu_free); |
1724 | return ERR_PTR(-ENOMEM); | 1724 | return ERR_PTR(-ENOMEM); |
1725 | } | 1725 | } |
1726 | 1726 | ||