From 734af4801ab02304560a902ec1cee15c351de6b5 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Sun, 2 Apr 2006 13:42:42 +0200 Subject: [PATCH] --- yaml --- r: 25221 b: refs/heads/master c: 9ba025f10885758975fbbc2292a5b9e7cb8026a8 h: refs/heads/master i: 25219: 7bcc90a644cbff8df2c0001aed4d020f534bc46b v: v3 --- [refs] | 2 +- trunk/ipc/shm.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 3805db1dc6e8..63123aaeeb08 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7ec70738097af9dfd25d5f83e9b27a532f462912 +refs/heads/master: 9ba025f10885758975fbbc2292a5b9e7cb8026a8 diff --git a/trunk/ipc/shm.c b/trunk/ipc/shm.c index f806a2e314e0..6b0c9af5bbf7 100644 --- a/trunk/ipc/shm.c +++ b/trunk/ipc/shm.c @@ -91,8 +91,8 @@ static inline int shm_addid(struct shmid_kernel *shp) static inline void shm_inc (int id) { struct shmid_kernel *shp; - if(!(shp = shm_lock(id))) - BUG(); + shp = shm_lock(id); + BUG_ON(!shp); shp->shm_atim = get_seconds(); shp->shm_lprid = current->tgid; shp->shm_nattch++; @@ -142,8 +142,8 @@ static void shm_close (struct vm_area_struct *shmd) mutex_lock(&shm_ids.mutex); /* remove from the list of attaches of the shm segment */ - if(!(shp = shm_lock(id))) - BUG(); + shp = shm_lock(id); + BUG_ON(!shp); shp->shm_lprid = current->tgid; shp->shm_dtim = get_seconds(); shp->shm_nattch--; @@ -283,8 +283,7 @@ asmlinkage long sys_shmget (key_t key, size_t size, int shmflg) err = -EEXIST; } else { shp = shm_lock(id); - if(shp==NULL) - BUG(); + BUG_ON(shp==NULL); if (shp->shm_segsz < size) err = -EINVAL; else if (ipcperms(&shp->shm_perm, shmflg)) @@ -774,8 +773,8 @@ long do_shmat(int shmid, char __user *shmaddr, int shmflg, ulong *raddr) up_write(¤t->mm->mmap_sem); mutex_lock(&shm_ids.mutex); - if(!(shp = shm_lock(shmid))) - BUG(); + shp = shm_lock(shmid); + BUG_ON(!shp); shp->shm_nattch--; if(shp->shm_nattch == 0 && shp->shm_perm.mode & SHM_DEST)