Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4828754pxj; Wed, 9 Jun 2021 02:55:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxptN0ZDWNqCOyfFe63OZF0191YuDlfuujqJ6cRnWGqQdtxfcKiyv6bGUz9FC2fyzJVpuP X-Received: by 2002:a02:a19e:: with SMTP id n30mr25706825jah.109.1623232528643; Wed, 09 Jun 2021 02:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623232528; cv=none; d=google.com; s=arc-20160816; b=OavF63zgv3gPtisgHXQI7xsN+zhlEPKqkueD6cg8SfWSOGKRt8Tvtrvev3BRxQ6KhW qbZ8nJ8qCLqla+LMixeq7zbYsCkbB/08hPNbTCo5DJB4b+YqkZjU/DFAHNR0iAf+qJ9L 7hcpue9f5oP3xpQ0FlAbAu04hZOPYIzHN7p3eKzQyoV0MnLwz9o7jGUnp7YnXVB+6dur A9YwvRzSZ6Z58OVeTqfBQnNEaYrGJdNel93rwY+Rx+TkuDNxr8YTaSytFoFXkeE2a+aE S6g+84lHdhKPjfJSBalkHtXkBmqrUtvAmZnvsD69hiuBad4kHthJZjG0P7jlw/ZIYVTY eP0w== 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=Pu/3XcWXy4mWJmYWo65vjI5GOXEIauT+GiuyUpG+E1k=; b=dPYndVtfEPM6sax0fMnpKupNzkq7+pca+Bl0NlDAeSG4E2FYS/syZ6/JLNJbBs42wO dtOfcTfFI+6U+1a4P713gYtcluYIN7iP/gozHF4jHFK+l+1HSKQ6g2ZOuAPOAx19cAW8 AihXRHzaDPCwvqShNwzZrfIY0anjCj47sJj0iR1/A5u+EwtwOhlh2hE+cPxNWHa6KZyy Ynm730lOMhnKRQOvDiKvKfmgVCpCl+cAcWssZKrZqZ0G+wrVO1S/RiDQHSYFmK2QGrFb IdPhPjVFUOXMKIn8WaBby7eQiGUGDpekhPrIktAI5Lq1lfxD58yeLDnHq+wf2EKdRtDs BEdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C+R6eG8r; 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 l2si2639934jad.33.2021.06.09.02.55.16; Wed, 09 Jun 2021 02:55:28 -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=C+R6eG8r; 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 S235170AbhFHSrg (ORCPT + 99 others); Tue, 8 Jun 2021 14:47:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42132 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235312AbhFHSmy (ORCPT ); Tue, 8 Jun 2021 14:42:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 695E0613D3; Tue, 8 Jun 2021 18:35:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177353; bh=oy1FAr+NNpZ5MJWeJjxdg+OMHrQSZwNpVeFG4CAO12c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C+R6eG8r34DAnWIi+1mQx1Sxx9n32dicYIE+BHq+vzEbJJc1Lz0fLIZB0+7dAthmP LC4Ua1KNgMvgcqOP68jsW4MqB7HR5wZpkZXUxuAoUTtHD8SuIMaCmhEJy2Ai3SIruC qTt/avG5ZOSvbrn1n28T9ou7VhuHZgXBeUn5EHI4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.4 21/78] ieee802154: fix error return code in ieee802154_llsec_getparams() Date: Tue, 8 Jun 2021 20:26:50 +0200 Message-Id: <20210608175935.980593923@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175935.254388043@linuxfoundation.org> References: <20210608175935.254388043@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: Wei Yongjun [ Upstream commit 373e864cf52403b0974c2f23ca8faf9104234555 ] Fix to return negative error code -ENOBUFS from the error handling case instead of 0, as done elsewhere in this function. Fixes: 3e9c156e2c21 ("ieee802154: add netlink interfaces for llsec") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20210519141614.3040055-1-weiyongjun1@huawei.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- net/ieee802154/nl-mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index d19c40c684e8..71be75112321 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -680,8 +680,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info) nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) || nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, be32_to_cpu(params.frame_counter)) || - ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) + ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) { + rc = -ENOBUFS; goto out_free; + } dev_put(dev); -- 2.30.2