From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbcDRIpz (ORCPT ); Mon, 18 Apr 2016 04:45:55 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:31189 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751797AbcDRIpw (ORCPT ); Mon, 18 Apr 2016 04:45:52 -0400 Date: Mon, 18 Apr 2016 11:44:49 +0300 From: Dan Carpenter To: "David S. Miller" , Willem de Bruijn Cc: Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch -next] udp: fix if statement in SIOCINQ ioctl Message-ID: <20160418084449.GA12410@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We deleted a line of code and accidentally made the "return put_user()" part of the if statement when it's supposed to be unconditional. Fixes: 9f9a45beaa96 ('udp: do not expect udp headers on ioctl SIOCINQ') Signed-off-by: Dan Carpenter diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index f186313..37e09c3 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -1276,12 +1276,6 @@ int udp_ioctl(struct sock *sk, int cmd, unsigned long arg) { unsigned int amount = first_packet_length(sk); - if (amount) - /* - * We will only return the amount - * of this packet since that is all - * that will be read. - */ return put_user(amount, (int __user *)arg); }