From patchwork Thu Jul 12 12:30:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10521645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8A01602B3 for ; Thu, 12 Jul 2018 12:30:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3566293B1 for ; Thu, 12 Jul 2018 12:30:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B75DC293C9; Thu, 12 Jul 2018 12:30:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A360E293B1 for ; Thu, 12 Jul 2018 12:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732289AbeGLMju (ORCPT ); Thu, 12 Jul 2018 08:39:50 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55824 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726761AbeGLMju (ORCPT ); Thu, 12 Jul 2018 08:39:50 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6CCTY4j015050; Thu, 12 Jul 2018 12:30:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=c6Pk03mr9OzUodVxw5KKRmJMf4AfljBjUsrjl+lLk90=; b=ZyVxqRjaFq7ftNF2n+6JinYrlJaMKdky1RVVg0CtN1/0h9qzM4dBo2DacNgKBL/7k1WX +BC3xnBYdJNmGP3OUwfBLOHapSQWjWGtPKEs4yoDIPKU+SYna3gjASo7q5UbMeYZa5vI fpwOZGd26Zqfm4v86yyIcNV1Sf7K35ZQUOQ+sOeIb0KUyz0c6wmMD47TYVfqOcF6eTYV A10+t3TQ1oKu2PkgrZ/hvmfdEthksKLobh3GCHPiQlGlj/EeXsDFMvkWyedEvbg3ahwx +MZ/tHnlDITglB/MIqOkmyTmYeiTGASH5dC3LaCiexSW/jRX5Qk7n0XUoIrN8fd7/1DT QQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2k2p7e3dts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 12:30:24 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6CCUNhl013861 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Jul 2018 12:30:23 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6CCUNlM003685; Thu, 12 Jul 2018 12:30:23 GMT Received: from kili.mountain (/41.202.241.62) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Jul 2018 05:30:22 -0700 Date: Thu, 12 Jul 2018 15:30:08 +0300 From: Dan Carpenter To: Trond Myklebust Cc: Jeff Layton , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] sunrpc: kstrtoul() can also return -ERANGE Message-ID: <20180712123008.3aejokccq2smpctq@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170113 (1.7.2) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8951 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=919 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807120131 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Smatch complains that "num" can be uninitialized when kstrtoul() returns -ERANGE. It's true enough, but basically harmless in this case. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index d2623b9f23d6..7bb3f2062045 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -50,7 +50,7 @@ static int param_set_hashtbl_sz(const char *val, const struct kernel_param *kp) if (!val) goto out_inval; ret = kstrtoul(val, 0, &num); - if (ret == -EINVAL) + if (ret) goto out_inval; nbits = fls(num - 1); if (nbits > MAX_HASHTABLE_BITS || nbits < 2)