From patchwork Tue Jun 8 18:26:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 455803 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4009022jae; Tue, 8 Jun 2021 11:44:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyG4uuMPyUVDtJ7gKE+wTbNoJXl6ELFP7S7hD68w3oLRf+PMSzNmWv4RVV+75e1q2x94xWy X-Received: by 2002:aa7:de8b:: with SMTP id j11mr27196960edv.363.1623177856376; Tue, 08 Jun 2021 11:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177856; cv=none; d=google.com; s=arc-20160816; b=PMwJL+OfjfjIY54OFRFvDvyjRqM/4nlIMbmb8RUCyLgivWznO3V0p+6rHRnMaLfaz5 wpeYOEGwfTgPNjKZGZAISpifI+v6/zZxWduk8r4/Jk2m5XhVW8ma4zrKvSTUjKg1TJ25 86tnZU/5/Yek02xDjiWPUYXYFDWiKcpr6cazqrdV3eYMbRo2NLPt3h9/O1TeVsuxYwul x8cQhc1+KQqVoLw/XzV3J/r3JqEDPpQTbtPJpTqlNIymUgj+CvbP/u/IoFUi0D6TjT7Y jkHOcPfAC2yaLubp8raNRimQ+zyqKGX8UVA9PyQG6Ipvz6cNqxNGXBKFPmEYXZZGcy4B xErQ== 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=XqJrjhhG3blnYqBdrbv1fg7E+vUFnMWVoYTfH9T3ob4=; b=03smVhU4FhphRp09kADARFbzC64WyTiGnmDX3AEtr276BfCsPfdhtIrb/g5NXJlYp6 sQgQzJ0bQM2c3yAWQZuvZL93ilt2KZ2x+E3bkFi4+KuHTvnnocntDiAOCg1MA7IswfWR E55VGuRffqxschrBh9IDEaU80FBb/pu3jXRE6uswY0/JEbPOUD/igNmiUpBiqWwuNxyU qI7RZkZQ+rk/EDub0OD2w8scmY0lXNarhg3x0epc39y7rQ10k5fQWaNajzW+XCXSvvqm ueo5BMH7Y1Vo54bSL3q/5P2Y7dFeXbBsZpUW/VDwB2VW1oVRLmfyUa1vH/QAZBJYNZ4y qLTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=O5KOhVEP; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 i8si367915edr.440.2021.06.08.11.44.16; Tue, 08 Jun 2021 11:44:16 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=O5KOhVEP; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S234981AbhFHSpy (ORCPT + 12 others); Tue, 8 Jun 2021 14:45:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38032 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235311AbhFHSmy (ORCPT ); Tue, 8 Jun 2021 14:42:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DCAA16143F; Tue, 8 Jun 2021 18:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177350; bh=iq+OnzuHjjjIKLdJUOmHU1txjGZ6gPhhdHnQeA8Ec8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5KOhVEPCmyFbMKNXkCI+4+i3Mzjx5mxRZaQtElS1b5B8kQrLDlOTt69+NITw+Ks5 JMAOLcIYgil1fc21Wg/NkG3NfsTKaOZgEO++CWDMseNL4GPt/ZeQShzRDV1lwxHkhk HZR6T4WOTm0YJ0ePY1VON6lIJXnX7+WOYYTq2yYc= 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 5.4 20/78] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:26:49 +0200 Message-Id: <20210608175935.948250760@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.2 diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index 2cdc7e63fe17..88215b5c93aa 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c @@ -241,8 +241,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);