From patchwork Tue Jun 8 18:26:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 455824 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp4026268jae; Tue, 8 Jun 2021 12:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDnm64bkCHXBMB4AMriBSLYRHaRZ3I7zYsiFZC93YSCdd6Y3ugRdPAmMzrNhXFePQB6YEb X-Received: by 2002:a17:907:92e:: with SMTP id au14mr24540352ejc.194.1623179176072; Tue, 08 Jun 2021 12:06:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623179176; cv=none; d=google.com; s=arc-20160816; b=XNKiOPl4Nzy6VG8Qdh0YzmuobnI0GsAj27po7wip5N9y0Khf64QdGFaCOhNvsjq6Iv FlUhSNNL13fcyh+vlQeQF0WEuD8tt257XV0jYv+tj4JF8H6MAeADvSAukan9jie7BORe oN6ifehdEI0QHvpfAUn6J1raCkIjIl0wXyKtS5jZomVMF7aakAaXNjsWx0Qhi32yayE/ gLEgVaghz6KG508OiPwC6CCRwINkvlU0KNc9ncMepep/XCt5cCUXM1GTYCpjJP6di15T eckOgpuTW5Mw1MwZlelS6NJQQBG2/zfzfjHlwOagQyL7E9uizREqVsAmxhzhGOPi1AK1 ndjg== 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=SpTjDV1b0+LwdFy5UT5jgi04YzpuBIsXEq54HY38a7S1zIrntmDyJZenD7hMHqhua4 cm1ZOvxJjfcY6a36bMFjW69aic1JdEFtSMG7UHsGF5cjQy67N+zusvuX8LFh+3Ifgv25 vnPPVHbtUyqN7OON5nw4naeO9ZHaiPiLTjnwNEXnEiEfJd2DqlAFMNHBrKa/uColjkc/ +WJ56T09GZA6CgJCqC1XMdj4iE3f6QXv0x+57SogTFqu92V5muQ+go8o/VUktqkA5my0 eVmYsWsRUO9sCzd3K49E6sWAa3v23aaRtBdygGHS9XZTsDfWO1/+cDTjb6iC0RxeNiOQ /Niw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qg7rdq9H; 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 x5si390764edv.602.2021.06.08.12.06.15; Tue, 08 Jun 2021 12:06: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=qg7rdq9H; 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 S236189AbhFHTH5 (ORCPT + 12 others); Tue, 8 Jun 2021 15:07:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:50488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235151AbhFHTG1 (ORCPT ); Tue, 8 Jun 2021 15:06:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B5AC36192E; Tue, 8 Jun 2021 18:46:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623178016; bh=iq+OnzuHjjjIKLdJUOmHU1txjGZ6gPhhdHnQeA8Ec8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qg7rdq9HxHzb40Sua/7rJuE38nPa5mCrd8v+pFhyWkiSNXZDVnlrCmkoOZaDruAVD XO89yvJ9Q2ipuMmuOVvZUaRgEYsiUrnAE8HC/W/SF/5sSXNt/kkmxeXWyZro2/2R7a C1RtzUYbGk8gZ8YKq5q2aUMWJx168/AjxHcymauU= 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.12 044/161] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:26:14 +0200 Message-Id: <20210608175946.957393109@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175945.476074951@linuxfoundation.org> References: <20210608175945.476074951@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);