From patchwork Tue Jun 8 18:26:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455796 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4003538jae; Tue, 8 Jun 2021 11:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMbrFZlcXiBIAvt16I60Mh6iLlbv931ou3l4CZvkmRwg/5eHn1iGorlR9WvoFUnx/ghVLx X-Received: by 2002:a17:906:63d2:: with SMTP id u18mr24879345ejk.186.1623177500192; Tue, 08 Jun 2021 11:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177500; cv=none; d=google.com; s=arc-20160816; b=m2/3bC8XKp1M+OWZd+KwI1mx31B6ii3D4Tgq8ZoSarhSPxzz7AK+OZzZHEa/KTcNIB bu5DnFjBBp45nTG/X3AoLcfOlt6MytF0l/dLSElSp69JoJPOz9gWblgwl8AP5vGFYTF1 RDU40AkEIrFW8LwIijx706ysRXms2LleGlizBD0SGXLXTfFURdnrlfZfJfxiR9UFKcnu aTXzOgx9DmEfD2EjDIJ8971uE7TMqCVtESpDmdI6qaKf6uH0lNItgG1Bc6M/nkNRcl7x RD5Aemfz2qMLRkSg2tWVnpeNiGiEmcAmmpl/2VflRYi7Hf3Zv1uCRXPVu8ECLf3lvTsg U/cA== 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=ipdX0ngjeNgZUjRfm8IIL8p7JYl5zEGJOrFnpMqn49Y=; b=rEMjCzu2MKXjZD1Ge2WGYdwSu7fXu17/1drena7xZztz14NMi3X9I5iMT7oKBUrCHQ o5vkNAyHHnnnMHsigpfYyCNFEfq4yvhJyqzNLpOljRuvPgARm3LsJdZ+VYuxuGsHpREm 987bt0US2B+BTGl7ZSqNoko6i7kQWRF9TS/2ewXHXK0pfHZA+dQB9ezEsGZm4gMNhy3m lZLc7lJuR+Gv8cKm/JbKxYqCFf4DLmPQeMYJLRSj7K8OrqhmMy0hyECv5atgdR0Xn4JU yNqjXW4eoTfuCbfHxKP00WzAtoVLK88BQjOTLgWomZlA3Y0xTgYrM8rha7KNCx+xfYYN 3OhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qr82zGnT; 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 e17si368537edq.196.2021.06.08.11.38.20; Tue, 08 Jun 2021 11:38:20 -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=qr82zGnT; 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 S234372AbhFHSkF (ORCPT + 12 others); Tue, 8 Jun 2021 14:40:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:57488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234821AbhFHShO (ORCPT ); Tue, 8 Jun 2021 14:37:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 11A65613DF; Tue, 8 Jun 2021 18:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177176; bh=UtuUwZ6YaJufvVbQdpEWkVaMmtDonz+bzzQcXOf546k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qr82zGnTIqWHvEB5+Xc0/rd51z23WXEg3NlIojJwHooEHOob2SOaEj+1Ie0xJp51A F7yVDqu7o+cRlJPH5ftVR4n7RVi1pA1zT7FZ/r2VZtY53BJVmfa1UeMqIYPq1QN17j 48CH1WRc8aAHf41pyqZ/gQr0nV6mD6r5ga5mgz1c= 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.19 14/58] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:26:55 +0200 Message-Id: <20210608175932.757112652@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175932.263480586@linuxfoundation.org> References: <20210608175932.263480586@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 b231e40f006a..ca1dd9ff07ab 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);