Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4822719pxj; Wed, 9 Jun 2021 02:43:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE2+d5nFpwCESq47JAqu5988Dzn17kYtsKRILgqekXbb8hU9DQxPInk9BFKMgh1StMlXBb X-Received: by 2002:a05:6638:1919:: with SMTP id p25mr9705605jal.115.1623231820030; Wed, 09 Jun 2021 02:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623231820; cv=none; d=google.com; s=arc-20160816; b=PwNRX88D3YKqzS+8QY+/Sdw7rWC4li5HkXF74eutwYmARLY5Do+mQf6ZDH+Z/bMYxx pqGb+L3pOsd5hcz2OVgpwCxyOTWloK16qXI9y68+JWE+C26sbj03sdfjp/kfX/fdybb4 CzBv+3RO6lfLgbwEl8aucsH6Y8Xi+2dAnhPV/PIKbp5b6omTpA7szIH1zwgl7txpdgjj lrOp/rZ16yuN1HzVh1uj5pO12czdxat9T0Eh33HtzDQlH5jrPw18NxnvXdGmmtnLVs7H 868knB2jf5oxKfnTc1FihK08iIjO4m82VZEHALntv/YzX9yQo8ZNFy1FAE0maSi+nOSf ZVFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YAnNRB32F9NGMOhs204revalaFWjMt/ahEfTpLt7tcU=; b=z1dWu6UdcKEEfJNIVfemr9qxu1ZBVj6RiW2CcwRA7aTAicCPgPLEIA2Ix+6G43Ddsg v4XCtFew3Zyqe2vUvt/0Rht1MAihv7TmU4RBqA0TXGBM94BRbfkaGFP/ZPL14uA7sAHe PkTTx2AH1L1nw2+24P+SUTizZNpnct5qKzRTWb1NIpoG4juyAWnRt2W2oqz0Kwyxseo1 jAhAV9h7x5srof/LTQuDq6d5Uy0Uecnzy4fU+AlhN4aDBCjSFzBmyZyyB4fCr7ifQlna yGKgoUzH9jOjtjpiMPfsSkgeIPP2NpreaUEb/zSqg4BuwXvRBnlrmZMP/uamputax4nH 8cOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xU8pfEMm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si3109399ill.152.2021.06.09.02.43.27; Wed, 09 Jun 2021 02:43:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xU8pfEMm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234528AbhFHSi2 (ORCPT + 99 others); Tue, 8 Jun 2021 14:38:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:34878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234350AbhFHSg2 (ORCPT ); Tue, 8 Jun 2021 14:36:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 620D6613E1; Tue, 8 Jun 2021 18:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177157; bh=5vTC6qkIRrpHNelYHeJL8pniOFg1DPsjjOyVMCGUroQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xU8pfEMmhO53ubkQMVnjvMBPzjBy0IPEi6bX4J1GehJpSB8lPLf3+zZqq3XBpe7Bl 9UFiDyluPy1QWIqEboOwx6atd8oPG/0vNupxwdPG/NzNi2PFM2ZIa/om/fhOq1dbs3 55cUQ40QQo6/wPbL1qZ5+w2YQgt+h7eXEtLMEbV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Stefan Schmidt , Sasha Levin Subject: [PATCH 4.14 11/47] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:26:54 +0200 Message-Id: <20210608175930.849166357@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175930.477274100@linuxfoundation.org> References: <20210608175930.477274100@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhen Lei [ Upstream commit 79c6b8ed30e54b401c873dbad2511f2a1c525fd5 ] Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: be51da0f3e34 ("ieee802154: Stop using NLA_PUT*().") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Link: https://lore.kernel.org/r/20210508062517.2574-1-thunder.leizhen@huawei.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- net/ieee802154/nl-phy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index dc2960be51e0..6a7fe415d5f4 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c @@ -249,8 +249,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info) } if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || - nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) + nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) { + rc = -EMSGSIZE; goto nla_put_failure; + } dev_put(dev); wpan_phy_put(phy); -- 2.30.2