Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4774534imm; Mon, 15 Oct 2018 22:58:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV635iCFCcM+Zfq1VJ3DmeW3mjB8NLpkgzfxDzNjBt44bZn/erCXzDTjyVkUTJ9OnHcEYtLOR X-Received: by 2002:a63:5f03:: with SMTP id t3-v6mr19170933pgb.68.1539669490682; Mon, 15 Oct 2018 22:58:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539669490; cv=none; d=google.com; s=arc-20160816; b=niE4VZU5ns0UFaKWT3m68QtGkqhQ2yqL/IQlARjDUY7pRiHP5fkj8KngIs+OWlDK8A acN+9Lerr6pX+cf3GKks3CZJ74WA/4oIZGN96DFUyozN+yG9/PfgMLdJq6f2pr498x5P LB5DJstWBhfRx3GFVV1cO4u3CwS7LhUoK9P5DnzKrD9B7RhAi8zCPJ9r59L5XP2u6mYM WeTbuzz/FCj8FnHjHCPFw0j7vlPoFbk1B1Yl2PHZESBY1PZUDZ6SWPxpDh5P11sOJCng R3DE40exUMa7KXXvz8C4+j8KRxAq04SV+4QOQaL3yYNygtTMr1Lu7jwSZtvttvnP5LGl HfXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=AzhOOh8fIqwzfJoh1Ug+dofUdb5/2B2sAeJeLcZ1x8I=; b=LCAtwBTVBdxHh9N7Z3So0LpUjmdhB7xn9LuE8w7gGEeVAp7EdqJiSKtsOeZ/B90JJk M4Y6cbHYQPCPz4qN7ODh930m4mrEBVU0GAtKn81eRB7hQuQUMUrhbOI2rCXIxR14l0Bm 2PQT3w07Y5ATIc7D5tEIr3Bu3W5MsrXeUfVhr13bfUuUavhVYwvgc3GvIaTCHg6U652a uKD1Nu++CKGvW71dWbH1W9zleyNO0UQgULOtSEPO0IQbLZTqwCiqdmRPYjssT1GjfpKJ ZxrOZ28+/b9rteqVV42FA1VsOgz3WIWm6OUTWKBVC6ffOPT4MOIKNjglCUHg3oYTD/Ee EAYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6-v6si13822296pfb.161.2018.10.15.22.57.54; Mon, 15 Oct 2018 22:58:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728072AbeJPNqS (ORCPT + 99 others); Tue, 16 Oct 2018 09:46:18 -0400 Received: from lgeamrelo13.lge.com ([156.147.23.53]:42788 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727507AbeJPNqS (ORCPT ); Tue, 16 Oct 2018 09:46:18 -0400 Received: from unknown (HELO lgeamrelo04.lge.com) (156.147.1.127) by 156.147.23.53 with ESMTP; 16 Oct 2018 14:57:28 +0900 X-Original-SENDERIP: 156.147.1.127 X-Original-MAILFROM: kyeongdon.kim@lge.com Received: from unknown (HELO localhost.localdomain) (10.168.176.142) by 156.147.1.127 with ESMTP; 16 Oct 2018 14:57:28 +0900 X-Original-SENDERIP: 10.168.176.142 X-Original-MAILFROM: kyeongdon.kim@lge.com From: Kyeongdon Kim To: davem@davemloft.net, ktkhai@virtuozzo.com, viro@zeniv.linux.org.uk, garsilva@embeddedor.com, jbaron@akamai.com, dvlasenk@redhat.com, xiyou.wangcong@gmail.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kyeongdon.kim@lge.com Subject: [PATCH v2] net: fix warning in af_unix Date: Tue, 16 Oct 2018 14:57:26 +0900 Message-Id: <1539669446-51996-1-git-send-email-kyeongdon.kim@lge.com> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This fixes the "'hash' may be used uninitialized in this function" net/unix/af_unix.c:1041:20: warning: 'hash' may be used uninitialized in this function [-Wmaybe-uninitialized] addr->hash = hash ^ sk->sk_type; Signed-off-by: Kyeongdon Kim --- net/unix/af_unix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index d1edfa3..98d34fb 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -225,6 +225,8 @@ static inline void unix_release_addr(struct unix_address *addr) static int unix_mkname(struct sockaddr_un *sunaddr, int len, unsigned int *hashp) { + *hashp = 0; + if (len <= sizeof(short) || len > sizeof(*sunaddr)) return -EINVAL; if (!sunaddr || sunaddr->sun_family != AF_UNIX) -- 2.6.2