Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4324921pxj; Tue, 8 Jun 2021 11:32:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkbD17k2yX1EOn9Pidy+PzVyPpGaxffRnZiJSCGdsIShom6NcVOY//kZhJdrJ0CgVJb67U X-Received: by 2002:a17:906:b308:: with SMTP id n8mr24923536ejz.93.1623177120187; Tue, 08 Jun 2021 11:32:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623177120; cv=none; d=google.com; s=arc-20160816; b=EXD0niobZ9p3hGUXIZyrf0uDZIioDQyBKhr8S375yFpIkWvdtECwNFbnJaOlediz73 uBkACaWpaCQ+UIZGTrXX7StcGCz7H6W5aJfGFa2O7+IqAyMXNtYCHQOORBKHo21jcHkA BN4cbL3d0x/KBXB4Yls1KlPvB+Dd2ZztLUhm3pN9FaGjD0ZK0y1B3ZTKnfiuoqRMID8Q V9znlbGwABrbO5WNJ+GY6dbUj/dDF2ZRIyaWKlpPFzCzy6s24V6rmt6JcbRMX1mjhOj2 G+9dm520GHrH5xrivzvHAWvZPNgmPTM6zn/bz5a/0xmEu0j0dQzOfK3pq7fR8SDUBYxv NgRg== 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=0jJNfslj/XH7dUtCL9wdksIkX02zHLjXddup7pbmL2bagMhvzJiwLFj64C6aJ7a0I0 TVkrLxZ6ZUth755V+nk1B9QCAAwZKdDA8IvoEMZDjHq22ArSnRPA08x9osyaSY/QXo7G 82LU0N0DEIDgabcKzVaALsX0HYmDzb8kQScwuivADgdz1cWEkaCdWf8jnFEu6WymMt4H 1NzWR9kOgxuu+GedQdBJtyKJFZim7d+CKH6CFcgQM9EL2f38GmR0SmcrDJxjDba6eJpo r5Zgi/ru3sZs305ESqLzzSlQOfpPRX5s93MYKY/rPQLzpXa6o7hq/UWGwU1/1KLWKgJ7 zZCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Vp7BR5AT; 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 bh4si393854ejb.680.2021.06.08.11.31.36; Tue, 08 Jun 2021 11:32:00 -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=Vp7BR5AT; 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 S233473AbhFHSbR (ORCPT + 99 others); Tue, 8 Jun 2021 14:31:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:55882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234047AbhFHSbA (ORCPT ); Tue, 8 Jun 2021 14:31:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D63961380; Tue, 8 Jun 2021 18:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623176947; bh=cq+BDAlz6yVWbPDX5SFSPBUVhukvOyz3I7Ra/jMwicA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vp7BR5ATi7ASXlvAm6lGReEU36zKnbGK/Gz+gQWdwIzBl4nGkBmisG/j9FoKnR4qh S8JgT+DYVzzVBV8EohGkM5kNxeeSy1+ZWC27D/7twIQ1ok0r6irAr7bE8d6b2/BLQD 0+8LPlXSewAkn06nmcWhz0BWIgYzojtDQ9euRmP4= 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.4 07/23] ieee802154: fix error return code in ieee802154_add_iface() Date: Tue, 8 Jun 2021 20:26:59 +0200 Message-Id: <20210608175926.783295651@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175926.524658689@linuxfoundation.org> References: <20210608175926.524658689@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