Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp830072pxj; Fri, 7 May 2021 23:26:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTBxnraPE2kNE1oM4Eg31u7+jCLv6+8qrP4xa3ri7QsO+UvVXChRKKslvrzA+HftdcYrvK X-Received: by 2002:a63:6cd:: with SMTP id 196mr14108399pgg.417.1620455191152; Fri, 07 May 2021 23:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620455191; cv=none; d=google.com; s=arc-20160816; b=EcoL7P7fqFGkWBOiNJ7YmH6Fwn7US8YSfmUTE06l9nVNVvj8clzjS9n+YihLKQcuzM MonhgIsQuvw91ex6dO4/RTHRPJJnnLJlFMMxlFFUcrdhizezOWbckKcbDNuF+AehKZEr vsQlFhDNbJCO4vpaJHqZmIKMNLfGTkoA3GNtMm9KYHpN498w7/84wE4ViRUMETS4NIQQ AbFTFByaK0gei/OuYT5S0FcXhl0ghw4eRAgG4LZ/rSe5c/GX6qsQ6HiOmVYBBvQ7KRx+ g1x/49gbbjBXP+pvV0TDES+MR/0crvYs4jFdKEw4UUlIMCboTpO2+Mw/+fxgMC2CYLr8 iUNQ== 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 :message-id:date:subject:cc:to:from; bh=/WJtz2HZJL0SWy3SK6S9umSZNpiadkwbF7W5KIm1W1g=; b=PC/N+0pKOH9lheDR8lGgRWTIV7pqwtSl5PYgdQ2z8SH8022aKj2naYkJRtx+TN0VR+ ucBQvW7BSksiWmPpurQF8psNaIVwD1iRtX1CPOD/OfgR5NY0/foWWTGIRfBIIhEGRTRa ThRd8mLe1hJwGjRYKq1kXHkTHr/UvQFjoOneOBWRX3QQ4db6Rpwl7swNUxqf4z6J/PVl ZuIksvUZ1fWSAOJzF6YDNgw/+gnNvOTCWCMawJmTz8cnLWMfXTzdwJLnOnDJ8AastGiq Vp13wR+UshpMeTLZIv/zNNjLUJwSAD4GmhfxFsOQi5Z/Ff4n+GRlAnvc8T2PpUzdUreO /s9A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si9556591pla.310.2021.05.07.23.26.17; Fri, 07 May 2021 23:26:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbhEHG0l (ORCPT + 99 others); Sat, 8 May 2021 02:26:41 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:18013 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbhEHG0k (ORCPT ); Sat, 8 May 2021 02:26:40 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fccfz5WVBzQjFm; Sat, 8 May 2021 14:22:19 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Sat, 8 May 2021 14:25:27 +0800 From: Zhen Lei To: Alexander Aring , Stefan Schmidt , "David S . Miller" , "Jakub Kicinski" , linux-wpan , netdev , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] ieee802154: fix error return code in ieee802154_add_iface() Date: Sat, 8 May 2021 14:25:17 +0800 Message-ID: <20210508062517.2574-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 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); -- 2.25.1