Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp104760pxj; Thu, 3 Jun 2021 01:56:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTkAwe7YRqFIquZuRlkdpGR0apdWJubOS8h0QWqV9d2u8OysogHZCoI05lsTtPcB8Z4mTH X-Received: by 2002:a05:6402:34c8:: with SMTP id w8mr42987078edc.243.1622710589413; Thu, 03 Jun 2021 01:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622710589; cv=none; d=google.com; s=arc-20160816; b=xRFUULInyuJOy+DSZk/6FKvXr4uaXxAlMBTUxTiWsuAPtRoixDFXJMz0MkE6TKbvJy JRecYcTNOjJNTMNR5U7TUrsr/0Ens9zfoKaesE+4MEYVlHrHe9mVGhY9XsMt3kUuzeHg 6QRcRaMcAgrAQIDu+g2o4y7dh1exy0Iz40eNA5wQOjsUdA+h2UU0mLOfpmHS1sdjn2k3 0BvpvFLCze2mIy0aC6IuVFT0+XD4CrDrvKd6Dp4WohBdkQH1QDVNbJmMSHDMLKOSrLKM tGH5jTXzlO8HW57WDWSmyVMEtVDECwV8Nzg/7r8+dAQFHS2OL06e8D8qV8KQVur5HYcD jvLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=joNf4+AILeuIn49vemAPcdrgOG/ZJnkV8zC3Ten9Yi0=; b=fpF9gsn2PUl4a1B46UHG8ChLEjqTro0sFlf8X0mg7aSbT1vXTyRb4XFuu/iXpXZsbF 71hdWQb4ncmlzLkjmrYC3rSK4cpoytTeBQj6geUuTPC/wXjKvzKX0wYXyhWPAi5IM0F2 W8SaagFhHEhz9dsAGAsVZZBEUCguqcrRDQzwEKoHmp49PF0irpG4wb589S5n09+PIghs LrmF+yvLXZB92NatqwdUtq4mhc/klKuR1ZB1Lr1Kh74O2d2kMTqB7GARnWzBbYk2wM4I ij4hJuSQRNXSUTvPiedHbGWZPMzPxoTdZpP9x9gjOKk9l6vdqtlGVZcAlDq/hepMt+aw wnfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@datenfreihafen.org header.s=2021 header.b=KAq4psuj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si1816696edx.150.2021.06.03.01.56.05; Thu, 03 Jun 2021 01:56:29 -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=@datenfreihafen.org header.s=2021 header.b=KAq4psuj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbhFCIzm (ORCPT + 99 others); Thu, 3 Jun 2021 04:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhFCIzl (ORCPT ); Thu, 3 Jun 2021 04:55:41 -0400 Received: from proxima.lasnet.de (proxima.lasnet.de [IPv6:2a01:4f8:121:31eb:3::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66C4DC06174A; Thu, 3 Jun 2021 01:53:57 -0700 (PDT) Received: from [IPv6:2003:e9:d722:28a1:9240:5b8a:f037:504] (p200300e9d72228a192405b8af0370504.dip0.t-ipconnect.de [IPv6:2003:e9:d722:28a1:9240:5b8a:f037:504]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id A472EC02EE; Thu, 3 Jun 2021 10:53:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenfreihafen.org; s=2021; t=1622710435; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=joNf4+AILeuIn49vemAPcdrgOG/ZJnkV8zC3Ten9Yi0=; b=KAq4psuj+Yagbs7GznIl9wEJNRpfDe2NH4Nq4otXtzGZ0Jc4vJly4zRxNzHvpmf5L94wuu 3K/yUBIT5XnLZUPplMohT1N9s+760qxqiwQ+1LPj7YAR5yMBfI+5AfCUSBx6E5ApoMfW/5 xBo3/vnI0ONWB3vYRqRWKmRUom/82BFC36U1HLs6ENO7uWBSA+ekUUR868naXF4ktUZqEm vjOnm6AaRVPRk2iCpsYgUrTT+VWSmKM3kk2XE4oz8JAuS5QmYfvX7crL/a9qd2yFiZzid2 FkY3nNq1T1gKWoX7kauzwHh/mTaYHYIeNcGIRrEp7MnPUxxwXhq10FtHAYzu7A== Subject: Re: [PATCH 1/1] ieee802154: fix error return code in ieee802154_add_iface() To: Zhen Lei , Alexander Aring , "David S . Miller" , Jakub Kicinski , linux-wpan , netdev , linux-kernel References: <20210508062517.2574-1-thunder.leizhen@huawei.com> From: Stefan Schmidt Message-ID: <03320214-828c-4ac8-0fb8-89bd78b85c97@datenfreihafen.org> Date: Thu, 3 Jun 2021 10:53:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210508062517.2574-1-thunder.leizhen@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 08.05.21 08:25, Zhen Lei wrote: > 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); > Good find. We could indeed hit a case where the IEEE802154_ATTR_HW_ADDR attribute is present and rc would be assigned 0 before reaching this goto nla_put_failure This patch has been applied to the wpan tree and will be part of the next pull request to net. Thanks! regards Stefan Schmidt