Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 348271
b: refs/heads/master
c: 85398aa
h: refs/heads/master
i:
  348269: 05800bc
  348267: 731315e
  348263: a92b0d6
  348255: 6075f66
v: v3
  • Loading branch information
Stanislav Kinsbursky authored and Linus Torvalds committed Jan 5, 2013
1 parent 45bf5a6 commit 1ddca6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a665531a3b7c2ad2c87903b24646be6916340e4
refs/heads/master: 85398aa8de1d68f44ff1b5d0ed9ceb2b0c51ce49
14 changes: 8 additions & 6 deletions trunk/ipc/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,15 +797,17 @@ static inline struct msg_msg *prepare_copy(void __user *buf, size_t bufsz,
return copy;
}

static inline void free_copy(int msgflg, struct msg_msg *copy)
static inline void free_copy(struct msg_msg *copy)
{
if (msgflg & MSG_COPY)
if (copy)
free_msg(copy);
}
#else
#define free_copy(msgflg, copy) do {} while (0)
#define prepare_copy(buf, sz, msgflg, msgtyp, copy_nr) ERR_PTR(-ENOSYS)
#define fill_copy(copy_nr, msg_nr, msg, copy) NULL
static inline void free_copy(struct msg_msg *copy)
{
}
#endif

long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
Expand All @@ -816,7 +818,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
struct msg_msg *msg;
int mode;
struct ipc_namespace *ns;
struct msg_msg *copy;
struct msg_msg *copy = NULL;
unsigned long __maybe_unused copy_number;

if (msqid < 0 || (long) bufsz < 0)
Expand All @@ -831,7 +833,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,

msq = msg_lock_check(ns, msqid);
if (IS_ERR(msq)) {
free_copy(msgflg, copy);
free_copy(copy);
return PTR_ERR(msq);
}

Expand Down Expand Up @@ -965,7 +967,7 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
}
}
if (IS_ERR(msg)) {
free_copy(msgflg, copy);
free_copy(copy);
return PTR_ERR(msg);
}

Expand Down

0 comments on commit 1ddca6c

Please sign in to comment.