From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net-next] net/smc: fix error return code in smc_setsockopt() Date: Sun, 03 Jun 2018 10:39:15 -0400 (EDT) Message-ID: <20180603.103915.1786492119200211803.davem@davemloft.net> References: <1527733882-149144-1-git-send-email-weiyongjun1@huawei.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: ubraun@linux.ibm.com, linux-s390@vger.kernel.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org To: weiyongjun1@huawei.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:35550 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbeFCOjR (ORCPT ); Sun, 3 Jun 2018 10:39:17 -0400 In-Reply-To: <1527733882-149144-1-git-send-email-weiyongjun1@huawei.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Wei Yongjun Date: Thu, 31 May 2018 02:31:22 +0000 > Fix to return error code -EINVAL instead of 0 if optlen is invalid. > > Fixes: 01d2f7e2cdd3 ("net/smc: sockopts TCP_NODELAY and TCP_CORK") > Signed-off-by: Wei Yongjun Although the TCP code should be checking this in the previous lines, it's not good practice to depend so tightly upon that. And it makes this code easier to audit if the check exists here explicitly too. So I'll apply this, thanks.