Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4822794pxj; Wed, 9 Jun 2021 02:43:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHqDuIHMP8KB//6cf0aWLJgwxlak6CpLQ9PO/h0KPVRCm0t8Vp9wA6HsClPTQebqhcpzDS X-Received: by 2002:a6b:db05:: with SMTP id t5mr22731253ioc.108.1623231828660; Wed, 09 Jun 2021 02:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623231828; cv=none; d=google.com; s=arc-20160816; b=MZyVS7lh0Xtue/8ebnqxpT1iA4VncSIuj4v4zBHNHzkt6qEff1bkIh7KDswXJQ8DP0 y0wOy4z8EgO292/BLti1U57icujvS8fRXPCq5P565aHXzYDZSnHQ32qoThDctxs0IbO+ 9lseAGV1emqpW2NU1ARoq500tT1IJGUsUkCAOtVnGZ0DRNPb9c+bUMuKm703G+C2PY2n WLDle/ZeKgsHMvqYj7GNEViYQxbJ0CbuN6xmV/wuklaTDSLpFhqk9cISmDTRsnzdON/L 6KtlV6ag9DzgjSdrrSiUeYeGmbk8eWBDAv6LFZxYGI9+su6Tev+7AWF3AmX6/5DJ54xt bdLA== 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=DNI++cFTMSEak1er3oBfgsVYd5XLW+CpmSLFizXZcuk=; b=dun1rRlkfDt8cT2V/E0MX8R8G6evfwaHkVpVRikw9E3U0zFcMjN33Y9q6JHlCiheUu kJDaNyQO3cpk8agWZKLkC4e0rQM7RnLFBN+KMrtbozy6yf6i1kmMr6kqT+pFZmgzyGcF CPJNXFlHBjkYyGKBq/a4lVhhr1b/T8Z6JnJg5kIDSXmoF1mUa5RfWlTPY3Ch81VRcik6 Vqv5audlzaZqCMuz/21d1siVM+eupbed7QMd6+PX+bjlya5LQxnpTsghjX4VR8OQwBEK /GzOdJ5UM1fWgQ3/9JJW6rjZ2OhoFPI52q0YccefBVOuYlhNWzX/IMFv4XfQ+yfA5IyC xE2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IXpdJl4s; 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 e1si2943806jap.46.2021.06.09.02.43.36; Wed, 09 Jun 2021 02:43:48 -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=IXpdJl4s; 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 S234713AbhFHSkG (ORCPT + 99 others); Tue, 8 Jun 2021 14:40:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:57970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234507AbhFHShI (ORCPT ); Tue, 8 Jun 2021 14:37:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E3F361352; Tue, 8 Jun 2021 18:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177179; bh=/Kk5XFC71RKixZ0KeWmKO2J/s1lNjqmgXRxjBCww5eM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IXpdJl4scheyFt0vA1iFYKSon7+kF6UxxuLub0QaI5AJB7LDsb0ek38PFFQ5fVzJM dA2MQXJadfz8buvOJqp+MGRsCyvMEMH4csHpTELKbvYSWRkzWxCBJW/d436LovmawG KXjc15/qKbdY7mPS6D13OAvBeRuUisqZEzNwdP4I= 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 4.19 15/58] ieee802154: fix error return code in ieee802154_llsec_getparams() Date: Tue, 8 Jun 2021 20:26:56 +0200 Message-Id: <20210608175932.789923710@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175932.263480586@linuxfoundation.org> References: <20210608175932.263480586@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 c0930b9fe848..7531cb1665d2 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -688,8 +688,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