Skip to content

Commit

Permalink
ipc: fix unused variable warning
Browse files Browse the repository at this point in the history
Commit a0d092f introduced the following warning:
ipc/msg.c: In function ?msgctl_down?:
ipc/msg.c:415: warning: ?msqid64? may be used uninitialized in this function

The gcc warning in this case is actually bogus, as msqid64 is touched only
iff cmd == IPC_SET, and in such case, copy_msqid_from_user() initializes
it properly.

Signed-off-by: Felipe Contreras <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
felipec authored and Jiri Kosina committed Dec 4, 2009
1 parent e9de25d commit f1970c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipc/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ static int msgctl_down(struct ipc_namespace *ns, int msqid, int cmd,
struct msqid_ds __user *buf, int version)
{
struct kern_ipc_perm *ipcp;
struct msqid64_ds msqid64;
struct msqid64_ds uninitialized_var(msqid64);
struct msg_queue *msq;
int err;

Expand Down

0 comments on commit f1970c4

Please sign in to comment.