Skip to content

Commit

Permalink
tools/testing/selftests/ipc/msgque.c: handle msgget failure return co…
Browse files Browse the repository at this point in the history
…rrectly

A failed msgget causes the test to return an uninitialised value in ret.
Assign ret to -errno on error exit.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Colin Ian King authored and Linus Torvalds committed Mar 11, 2014
1 parent 1443176 commit 5394223
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/ipc/msgque.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ int main(int argc, char **argv)

msgque.msq_id = msgget(msgque.key, IPC_CREAT | IPC_EXCL | 0666);
if (msgque.msq_id == -1) {
err = -errno;
printf("Can't create queue\n");
goto err_out;
}
Expand Down

0 comments on commit 5394223

Please sign in to comment.