Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4326372pxj; Tue, 8 Jun 2021 11:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHQ4C14GfrkzxDCgvE14LnJ7ZQuv2uBWFiztEXnn1x4mtB4myKBHDE2mtRm471KpwlsDZe X-Received: by 2002:aa7:ccc1:: with SMTP id y1mr772218edt.333.1623177254641; Tue, 08 Jun 2021 11:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177254; cv=none; d=google.com; s=arc-20160816; b=Cxo8SbzzSbgrWLbnNTB8T76V7emSXqLeYcLuq7e08yHTP1HTODLywcFihzzLzAd5Gj dyFw1VVzFdfy7B2pefs7EJilVPME8JPBmd/f9W/9sRwMXu9ON8/L546j8r2fHFxOXeIM xQHLi+Td4wl2Cuk2sNL0oYyshFzj8qO+n/YOZKhNO7hydNpAvE/J37SvqtAH7O1d2taL aeEh/pGj7pnt9HCHMLPgIwSoIVXeyMDCOTplnrQO6wTdQXJcogNzbyGgdU7AUmKvMTNQ WbvZMxE47cYdUOxJWoE3H/Nw7g56s+N5+/jCWQd/QAGH08+gCdY+DnpNp8V2L53ptO6v O8zw== 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=fQlo6ak4GDGJ0MEacg3BDQ2NACjQKOPvwxbcAQUOB3E=; b=tUHrhO/d+GcHSW/PUQkjzGO/nEgb2N93gPjpVHM89Qf91c8ofOtNBQE6/shKdevlkn 6ENFCWwCGAEFzP91WBHfXHPmwrwdD1GuOgBngwp91A27DFbOyWJnz4dE01ltt8Ovb5Cm Ee/rOqB96ixMEwoRf7cDqPbG8wfO8Efjk4P5/CGDl5gXkIUySEvNAS3d5mM4gHQEH4SC WBPzWqvSKQ2Z3vUTJQhf6VswO1AmkG9v2xEDLXCVUDiI8GOsIPnkdMdXXnM/5GXJlJPL yqrHewd8RQ7pw8mSEIdr8l+tBpyABC8nzGs4u9TdsSYP4WVu1BEnoXJOFPMfvoQFfN32 JTbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=i2rZuXdj; 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 c10si414979edn.209.2021.06.08.11.33.50; Tue, 08 Jun 2021 11:34:14 -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=i2rZuXdj; 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 S234507AbhFHSdB (ORCPT + 99 others); Tue, 8 Jun 2021 14:33:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:57434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234342AbhFHScL (ORCPT ); Tue, 8 Jun 2021 14:32:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6E82A613CA; Tue, 8 Jun 2021 18:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177018; bh=cq+BDAlz6yVWbPDX5SFSPBUVhukvOyz3I7Ra/jMwicA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i2rZuXdjrWZuWTGEUOZ12XpVvIyWodtZMpIo3WAIw3vKDE2yK41JygYkZTeTcoIFn XlZWk1sF0GlXYomY1QvL8Yg4AE9Yq/naKswSB2kRgrQQikWl1cLN3LOn/LRk+Yf1x5 yLOsmQD/3yUn7KVdH1zQsbJzWQknPhcSGUx/jPMc= 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.9 11/29] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:27:05 +0200 Message-Id: <20210608175928.184179568@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175927.821075974@linuxfoundation.org> References: <20210608175927.821075974@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 77d73014bde3..11f53dc0c1c0 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