From: Andrew Morton Date: Thu, 26 May 2011 23:25:15 +0000 (-0700) Subject: Documentation/accounting/getdelays.c: handle sendto() failures X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4ed960b14d3b5fd14f1d9eb02f6d7e398317627a;p=linux-beck.git Documentation/accounting/getdelays.c: handle sendto() failures Fixes Documentation/accounting/getdelays.c: In function `get_family_id': Documentation/accounting/getdelays.c:172:14: warning: variable `rc' set but not used [-Wunused-but-set-variable] Reported-by: "Justin P. Mattock" Cc: Balbir Singh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c index 16e16d57b9eb..fed225401dd2 100644 --- a/Documentation/accounting/getdelays.c +++ b/Documentation/accounting/getdelays.c @@ -177,6 +177,8 @@ static int get_family_id(int sd) rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY, CTRL_ATTR_FAMILY_NAME, (void *)name, strlen(TASKSTATS_GENL_NAME)+1); + if (rc < 0) + return 0; /* sendto() failure? */ rep_len = recv(sd, &ans, sizeof(ans), 0); if (ans.n.nlmsg_type == NLMSG_ERROR ||